Feature Wiki

Information about planned and released features

Tabs

Validating Import

Implementing this Feature Requests depends on the availability of

1 Initial Problem

  •  Export files can be imported by uploading a zip archive or by selecting a file from the ILIAS "Upload Directory". In neither case the xml are validated against an xml schema or dtd.
  • Renaming ILIAS export files on the local computer and trying to import them is currently rejected. 
  • It is assumed that export zip.-files were scanned for viruses before the import and do not concern ourselves with this question in the feature request. 
  • If the import aborts and gets stuck without an error message. 
  • The person doing the import must instist on informing the administrator who then in turn is to sieve through the logs. The administrator has no error message telling what to look for, which specific object caused the abort. 
  • This is more cumbersome than it should be. 
  • Implementing Move Add New Item to Toolbar and into Modal should not be made impossible by this request. 

2 Conceptual Summary

  • Parsing and generating XML files will be implemented using the PHP extensions "SimpleXML" and XMLWriter" to improve maintainablity. 
  • Manifest files are validated against a local schema definition. See "Technical information" for consequences.
  • XML from components that provide a schema definition are validated against the local definition
  • Head- und Tail-Dependencies from components that provide a schema definition are validated against the local definition
  • Improve permission handling - the import is not overly diligent when it comes to importing not-repository-objects like users and stlyes to check for create permissions. This would improve security if importer classes always check for permissions and settings like the deactivation of creation of a certain object type. 

2.1 Concept

This is not needed to be implemented for every module with ILIAS 9

2.2 Workflow for User 

  1. User clicks on "Add New Item". 
  2. ILIAS presents Create-dialogue with options in accordions.
  3. User selects "Option 2: Import Object Type" and uploads xml.zip of export-file. 
  4. ILIAS starts validating the object and runs into trouble.
  5. User is presented with information what is causing the trouble.:
    • For individual objects a message is presented "The uploaded file is not a valid export file: Imported export file misses x.  Please rectify export file."
    • For container objects a message is presented "Container Type comprises x objects. At least one does not validate. Please rectify all export files indict
      • Type | Title | Component  | Validation statement.
      • ...
      • Type | Title | Component | Validation statement.".
  6. ILIAS aborts the import.

3 User Interface Modifications

3.1 List of Affected Views

  • Create-Dialogue 

3.2 User Interface Details

Mock up for Wiki
Import of an individual object is aborted upon validation failure. Validation failure statement is presented exactly were import error messages are presented in ILIAS 9.
Mock-up for Group
Import of a container with message on validating comprised objects. All objects are presented as a flat list.

3.3 New User Interface Concepts

No new UI elements are needed. 

3.4 Accessibility Implications

There are no foreseen accessibility issues. 

4 Technical Information

XML files are always validated against a local schema definition. An alternative would be to validate against schema definitions deployed on a central instance. However, this would have the consequence that imports of installations can only be carried out if firewall and/or proxy shares are configured for this instance.

Validation of import files in detail:

  1. ILIAS extracts the zip archive
  2. The main manifest XML - which describe the strucure of the archive - is validated against the manifest schema definition.
  3. The main manifest file will be parsed and the component manifest files of all "export sets" will be validated against the manifest schema definition.
  4. The "SchemaVersion" attribute is extracted from all component xml files and the corresponding schema definitions are used for validating the xml content. If no corresponding schema is found, the newset schema will be used. If no schema is found no validation is done.

Failing steps will stop the validation and present a failure message.

Main Manifest
Main Manifest
Component Manifest
Component Manifest
Component XML
Component XML

5 Privacy Information

There are no foreseen privacy issues. 

6 Security Implications

There are no foreseen security issues. 

7 Contact

8 Funding

If you are interest in funding this feature, please add your name and institution to this list.

9 Discussion

Kergomard, Stephan [skergomard], 14 SEP 2023: I don't see how we can discuss this now. The presentation is completely vague. The only thing I actually see that would be understandable is in the section "Technical Information". But what does that mean? What happens if it doesn't validate? It is written that not all Modules need to use this, but do we have a path to get there? I think the topic is very important, but it needs a far clearer concept then this as far as I'm concerned.

Killing, Alexander [alex], 14 Sep 2023: It is important to note, that the schema definition files should be provided by the maintainers since ILIAS 4.1, see the developoment guide: https://docu.ilias.de/goto_docu_pg_32894_42.html

Many of these exist, see https://github.com/ILIAS-eLearning/ILIAS/tree/trunk/xml

If maintainers kept these up-to-date (we asked for this in a previous jour fixe), nothing has to be done. The import will just add one additional step per export file that matches a xsd file: run the validation. If invalid, it will of course throw an error (like we already have, if files of wrong types are imported) and create an appropriate log entry.

JourFixe, ILIAS [jourfixe], 18 SEP 2023 : We highly appreciate this suggestion and schedule the feature for ILIAS 9. We see it as a first step towards a better import and export of objects. Next step should be a general discussion how to improve the export/import process.

10 Implementation

{The maintainer has to give a description of the final implementation and add screenshots if possible.}

Test Cases

Test cases completed at 2023-10-20 by Spirou, Ilias [ispirou]

  • 63548 : Kurs mit fehlerhaften Lernzielen importieren
  • 63549 : Kurs mit fehlerhafter Struktur importieren
  • 63547 : Kurs mit fehlerhafter Manifest-Datei importieren
  • 63546 : Kurs mit unbenannter ZIP-Datei importieren

Approval

Approved at 25.10.2023 by Karola Koch.

Last edited: 25. Oct 2023, 13:16, Koch, Karola [kkoch]