Code Monkey home page Code Monkey logo

onlyoffice's Introduction

ILIAS Plugin OnlyOffice

GitHub release (latest SemVer) GitHub closed issues GitHub issues GitHub closed pull requests GitHub pull requests

This plugin offers a way to connect an OnlyOffice document server to ILIAS. Users can upload files by creating an ILIAS repository object, which then can be collaboratively edited in OnlyOffice's online editors.

Getting Started

Installation

You need to adjust placeholders (Applies everywhere)

Add in your Dockerfile based on flux-ilias-ilias-base

RUN /flux-ilias-ilias-base/bin/install-archive.sh https://github.com/fluxapps/OnlyOffice/archive/refs/heads/main.tar.gz /var/www/html/Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice

Extends your docker-compose.yaml

services:
    onlyoffice:
        environment:
            - JWT_ENABLED=true
            - JWT_SECRET=...
        image: onlyoffice/documentserver:latest
        ports:
            - [%host_ip%:]8181:80
        volumes:
            - ./data/onlyoffice-cache:/var/lib/onlyoffice
            - ./data/onlyoffice-data:/var/www/onlyoffice/Data
            - ./data/onlyoffice-postgresql:/var/lib/postgresql
            - ./data/log/onlyoffice:/var/log/onlyoffice

Use http[s]://%host%:8181 as ONLYOFFICE root URL in plugin configuration

Other Installations

Please have a look at the configurations files docker-compose-ee.example.yml, env.example.config, nginx.reverse.example.config for the deployment of onlyoffice-enterprise in the doc folder.

Development

Unfortunately port forward to host's loopback network is not possible, because ILIAS and OnlyOffice communicates with the same ONLYOFFICE root URL configuration

The easist way is to create a specific docker network and assign a static IP, which can reached inside the containers and from your host

Extends your docker-compose.yaml

services:
    database:
        networks:
            - ilias
    ilias:
        environment:
            [- ILIAS_CHATROOM_CLIENT_PROXY_CLIENT_URL=http://%chatroom_ip%:8080]
            - ILIAS_HTTP_PATH=http://%ilias_ip%
        networks:
            - ilias
    nginx:
        networks:
            ilias:
                ipv4_address: %ilias_ip%
#        ports:
#            - [%host_ip%:]80:80
    [cron:
        networks:
            - ilias]
    [ilserver:
        networks:
            - ilias]
    [chatroom:
        networks:
            ilias:
                ipv4_address: %chatroom_ip%
#        ports:
#            - [%host_ip%:]8080:8080]
    onlyoffice:
        networks:
            ilias:
                ipv4_address: %onlyoffice_ip%
#        ports:
#            - [%host_ip%:]8181:80
networks:
    ilias:
        ipam:
            config:
                - subnet: %ilias-subnet%

Use http://%onlyoffice_ip% as ONLYOFFICE root URL in plugin configuration

Other

Requirements
  • ILIAS 6.x / 7.x
  • PHP >= 7.1
  • OnlyOffice Docs 7.2.2
Simple Docker Installation Guide for Developers

A simple installation guide for developers using docker can be found here.

Install OnlyOffice

Install the desired edition of OnlyOffice Docs on your server. Note that the free community edition allows only 20 simultaneous connections. Installation Guides can be found here We recommend using docker-compose for installation as specifications can easily be set within the .yml file. We also recommend to set up HTTPS.

Security Configuration in OnlyOffice

(Note that this can only be done if you installed OnlyOffice docs using docker compose!)
Open your OnlyOffice's docker-compose.yml file. In onlyoffice-documentserver.environment section, uncomment all variables starting with "JWT". Set a safer password in JWT_SECRET variable.

Install OnlyOffice-Plugin

Start at your ILIAS root directory

mkdir -p Customizing/global/plugins/Services/Repository/RepositoryObject
cd Customizing/global/plugins/Services/Repository/RepositoryObject
git clone https://github.com/fluxapps/OnlyOffice.git OnlyOffice

Now you can install, update & activate the OnlyOffice plugin in your ILIAS installation.

Configure ILIAS

Start at your ILIAS root directory. Open .htaccess file. Add the following line:

Header set Access-Control-Allow-Origin "https://onlyoffic_docs.example"

Where "onlyoffice_docs.example" is the name of the server where OnlyOffice Docs is installed. If you did not set up https, use "http://" instead.

Next you must navigate to the plugin's configuration form. Enter the root URL of your OnlyOffice Docs installation. Enter the JWT-Secret which you specified in OnlyOffice's docker-compose.yml file.

Troubleshooting
  1. If the OnlyOffice window opens up but you can't access the file make sure that your webserver user has read and write access to the plugin folder and the data folder where the files are saved.

License

This project is licensed under the GPL v3 License

Maintenance

This is an OpenSource project by fluxlabs ag, [email protected]

About fluxlabs plugins

Please also have a look at our other key projects and their MAINTENANCE.

The plugins that require a rebuild and the costs are listed here: REBUILDS

onlyoffice's People

Contributors

fluxdw avatar fluxfw avatar fluxjd avatar jheim2 avatar mstuder avatar rob0403 avatar

Watchers

 avatar

onlyoffice's Issues

Download von Dokument Versionen funktioniert wegen unvollständigem Pfad nicht: File not found

Auf der Seite, wo nach Verlassen des Dokuments die Versionen für den Download gelistet werden, kam beim Download Versuch bei unseren Plugin Installationen stets "File not found".

Konnte es so fixen in Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice/templates/html/tpl.file_history.html :

function renderBody() {​​​​​​
const url_array = JSON.parse('{​​​​​​URL}​​​​​​');
const base_url = '{​​​​​​BASE_URL}​​​​​​';
const data = JSON.parse('{​​​​​​TBL_DATA}​​​​​​');
let table = "";
let limit = Math.min(data.length, {​​​​​​LIMIT}​​​​​​)
for (let i = 0; i < limit ; i++) {​​​​​​
var rowData = data[i];
var version = rowData.version;
alt: var url = url_array[version];
neu: var url = base_url + url_array[version];
....

Benennung von Rechten/Rollen

Liebe Programmierer, wir haben eben an unserer Schule das Plugin eingebunden. Vielen Dank!
Uns ist aufgefallen:
Bei den Rechteeinstellungen sind einige Rechte nicht benannt.

image

Viele Grüße,
Andreas Zwerger
FWG Freiburg

ILIAS7 composer dump-autoload Fehler

Huhu,

aktuell erzeugt das Plugin folgenden Fehler wenn man composer mit dem Plugin ausführt:

Building Static Artifacts for ILIAS
===================================

PHP Fatal error:  Trait 'srag\DIC\OnlyOffice\DICTrait' not found in /srv/www/ilias/Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice/classes/class.ilObjOnlyOffice.php on line 16
PHP Stack trace:
PHP   1. {main}() /srv/www/ilias/setup/cli.php:0
PHP   2. Symfony\Component\Console\Application->run($input = *uninitialized*, $output = *uninitialized*) /srv/www/ilias/setup/cli.php:39
PHP   3. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build-artifacts', 1 => '--yes']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['yes' => TRUE]; protected $arguments = ['command' => 'build-artifacts']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /srv/www/ilias/libs/composer/vendor/symfony/console/Application.php:149
PHP   4. Symfony\Component\Console\Application->doRunCommand($command = class ILIAS\Setup\CLI\BuildArtifactsCommand { private ${Symfony\Component\Console\Command\Command}application = class ILIAS\Setup\CLI\App { private ${Symfony\Component\Console\Application}commands = [...]; private ${Symfony\Component\Console\Application}wantHelps = FALSE; private ${Symfony\Component\Console\Application}runningCommand = ...; private ${Symfony\Component\Console\Application}name = 'The ILIAS Setup'; private ${Symfony\Component\Console\Application}version = 'UNKNOWN'; private ${Symfony\Component\Console\Application}commandLoader = NULL; private ${Symfony\Component\Console\Application}catchExceptions = TRUE; private ${Symfony\Component\Console\Application}autoExit = TRUE; private ${Symfony\Component\Console\Application}definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private ${Symfony\Component\Console\Application}helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private ${Symfony\Component\Console\Application}dispatcher = NULL; private ${Symfony\Component\Console\Application}terminal = class Symfony\Component\Console\Terminal { ... }; private ${Symfony\Component\Console\Application}defaultCommand = 'list'; private ${Symfony\Component\Console\Application}singleCommand = FALSE; private ${Symfony\Component\Console\Application}initialized = TRUE }; private ${Symfony\Component\Console\Command\Command}name = 'build-artifacts'; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = []; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ''; private ${Symfony\Component\Console\Command\Command}description = 'Build static artifacts from source'; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMerged = TRUE; private ${Symfony\Component\Console\Command\Command}applicationDefinitionMergedWithArgs = TRUE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = ['short' => 'build-artifacts [options]', 'long' => 'build-artifacts [-y|--yes] [--plugin PLUGIN] [--no-plugins] [--skip SKIP]']; private ${Symfony\Component\Console\Command\Command}usages = []; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = [...]; private $command = NULL }; protected $agent_finder = class ILIAS\Setup\ImplementationOfAgentFinder { protected $refinery = class ILIAS\Refinery\Factory { ... }; protected $data_factory = class ILIAS\Data\Factory { ... }; protected $lng = class ilSetupLanguage { ... }; protected $plugin_raw_reader = class ilPluginRawReader { ... }; protected $interface_finder = class ILIAS\Setup\ImplementationOfInterfaceFinder { ... }; protected $predefined_agents = [...] } }, $input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build-artifacts', 1 => '--yes']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['yes' => TRUE]; protected $arguments = ['command' => 'build-artifacts']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /srv/www/ilias/libs/composer/vendor/symfony/console/Application.php:275
PHP   5. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build-artifacts', 1 => '--yes']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['yes' => TRUE]; protected $arguments = ['command' => 'build-artifacts']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /srv/www/ilias/libs/composer/vendor/symfony/console/Application.php:1021
PHP   6. ILIAS\Setup\CLI\BuildArtifactsCommand->execute($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build-artifacts', 1 => '--yes']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['yes' => TRUE]; protected $arguments = ['command' => 'build-artifacts']; protected $interactive = TRUE }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private $stderr = class Symfony\Component\Console\Output\StreamOutput { private $stream = resource(3) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... } }; private $consoleSectionOutputs = []; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } } }) /srv/www/ilias/libs/composer/vendor/symfony/console/Command/Command.php:255
PHP   7. ILIAS\Setup\CLI\BuildArtifactsCommand->getRelevantAgent($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'build-artifacts', 1 => '--yes']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = FALSE; private $hasOptional = FALSE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = ['yes' => TRUE]; protected $arguments = ['command' => 'build-artifacts']; protected $interactive = TRUE }) /srv/www/ilias/src/Setup/CLI/BuildArtifactsCommand.php:45
PHP   8. ILIAS\Setup\ImplementationOfAgentFinder->getAgents() /srv/www/ilias/src/Setup/CLI/HasAgent.php:48
PHP   9. ILIAS\Setup\ImplementationOfAgentFinder->getPluginAgent($name = 'OnlyOffice') /srv/www/ilias/src/Setup/ImplementationOfAgentFinder.php:78
PHP  10. iterator_to_array($iterator = class Generator {  }) /srv/www/ilias/src/Setup/ImplementationOfAgentFinder.php:137
PHP  11. ILIAS\Setup\ImplementationOfInterfaceFinder->getMatchingClassNames($interface = 'ILIAS\\Setup\\Agent', $additional_ignore = [], $matching_path = '[/]Customizing/global/plugins/.*/.*/OnlyOffice/.*') /srv/www/ilias/src/Setup/ImplementationOfAgentFinder.php:137
PHP  12. ReflectionClass->__construct($argument = 'ilObjOnlyOffice') /srv/www/ilias/src/Setup/ImplementationOfInterfaceFinder.php:60
PHP  13. spl_autoload_call($class_name = 'ilObjOnlyOffice') /srv/www/ilias/src/Setup/ImplementationOfInterfaceFinder.php:60
PHP  14. Composer\Autoload\ClassLoader->loadClass($class = 'ilObjOnlyOffice') /srv/www/ilias/src/Setup/ImplementationOfInterfaceFinder.php:60
PHP  15. Composer\Autoload\includeFile($file = '/srv/www/ilias/libs/composer/vendor/composer/../../../../Customizing/global/plugins/Services/Repository/RepositoryObject/OnlyOffice/classes/class.ilObjOnlyOffice.php') /srv/www/ilias/libs/composer/vendor/composer/ClassLoader.php:428
PHP  16. include() /srv/www/ilias/libs/composer/vendor/composer/ClassLoader.php:571
Script @php setup/cli.php build-artifacts --yes handling the post-autoload-dump event returned with error code 255

Wir haben das jetzt einmal etwas dreckig auf folgende Weise gefixt:

# classes/class.ilObjOnlyOffice.php

require_once __DIR__ . '/../vendor/autoload.php';
use srag\Plugins\OnlyOffice\ObjectSettings\ObjectSettings;
use srag\Plugins\OnlyOffice\Utils\OnlyOfficeTrait;
use srag\DIC\OnlyOffice\DICTrait;
[...]

Allerdings bin ich mir sicher dass es hierfür eine sauberere Lösung geben muss...

Einstellungsmaske, welche Dateitypen unterstützt werden

Discussed in #6

Originally posted by **mstuder** August 30, 2022

Es wäre gut, man könnte in er Plugin-Administration festlegen, welche Dateitypen das OnlyOffice Plugin unterstützt.

Konfiguration

  • In der Plugin-Konfiguration werden in einer Textbox alle von Only Office unterstützten Datei-Typen aufgelistet. Diese Liste ist anpassbar. Im Frontend werden nur Dateitypen zugelassen, welche in der Liste stehen.

Die Liste soll kommasepariert sein.
image
Screenshot - ILIAS Administration > Systemeinstellungen und Wartung > Datei-Services

  • Als Kommentar unterhalb der Textbox die Liste der grundsätzlich von OnlyOffice unterstützten Dateitypen auflisten, damit ein Admin, welcher die Liste bearbeitet einen Hinweis hat. Ein Admin kann unabhängig des Kommentars zusätzliche Dateiformate hinzufügen (notwendig, wenn Only Office einmal mehr Dateitypen unterstützt und das Plugin noch nicht nachgezogen ist)

  • Die Liste in der Textbox soll alphabetisch sortiert werden.

  • Wenn ein User im Frontend ein nicht unterstützer Dateityp hochlädt, bekommt er eine Fehlermeldung (roter Kasten) mit dem Hinweis der grundsätzliche unterstützten Dateitypen.

Standard-Sprache im api-call?

Gemeldet durch @rob0403: Bei uns ist die Standard-Sprache beim Aufruf eines OO-Dokuments "Englisch". Ist das ein Parameter, den das Plugin je nach eingestellter Systemsprache mitsenden könnte oder muss das global für OO auf deutsch geändert werden?

Titel aus Dokument wird nicht übernommen

In der Byline zu "Titel" steht folgendes: "Falls kein Titel eingegeben wird, wird der Titel der Datei übernommen.". Dies ist aber meiner Erinnerung nach nicht mehr gewünscht und wurde bereits umgebaut. Die entsprechenden Spuren scheinen aber noch im Code zu sein. Ich erinnere mich leider nicht mehr ganz genau, wieso wir uns dagegen entschieden haben. Eventuell wegen Sonderzeichen im Titel?

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.