Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

XML Administrator Settings: Difference between revisions

From MoodleDocs
No edit summary
m (Text replacement - "class="nicetable"" to "class="wikitable"")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__TOC__
{{GSOC 09}}
This project will create a administrative interface for importing and exporting site-wide configurations.  These settings can be applied either individually or with specified priorities.
 


== Motivation ==
== Motivation ==
I want to create a new administrative interface for importing and exporting site-wide configuration (tracker issue MDL-18548). At the basic level, it would allow administrators to save their site settings in an XML file, as well as import other saved configurations. Administrators will be able to select a subset of all settings to create a template. They can then apply templates to their site settings, either individually or with specified priorities. Moodle will then adjust change setting to the value in the highest-priority template, and then use either the current or default settings for whatever remains.
I want to create a new administrative interface for importing and exporting site-wide configuration (tracker issue MDL-18548). At the basic level, it would allow administrators to save their site settings in an XML file, as well as import other saved configurations. Administrators will be able to select a subset of all settings to create a preset. They can then apply presets to their site settings, either individually or with specified priorities. Moodle will then adjust change setting to the value in the highest-priority preset, and then use either the current or default settings for whatever remains.


== Other Discussion==
== Other Discussion==
*[https://docs.moodle.org/en/Talk:Projects_for_new_developers#XML_templates_for_admin_settings Projects for new developers: XML templates for admin settings]
*[https://docs.moodle.org/en/Talk:Projects_for_new_developers#XML_presets_for_admin_settings Projects for new developers: XML presets for admin settings]
*[http://moodle.org/mod/forum/discuss.php?d=118494#p528195 Forum discussion]
*[http://moodle.org/mod/forum/discuss.php?d=118494#p528195 Forum discussion]
*Tracker Issue MDL-18548
*Tracker Issue MDL-18548
Line 13: Line 15:
*[https://docs.moodle.org/en/Development:Admin_settings How Admin settings work]
*[https://docs.moodle.org/en/Development:Admin_settings How Admin settings work]


==Needs Assesment==
==User Requested Features==
This is a current list of features that have been suggested/requested. This is not the finalized list and will need a community review:
This is a current list of features that have been suggested/requested. This is not the finalized list and will need a community review:
*Selection of settings to export (grouped in a tree format as displayed in the administrator panel)
*Selection of settings to export (grouped in a tree format as displayed in the administrator panel)
*Naming and saving of XML files as special "templates" to be applied to a new install of Moodle for specific situations.
*Naming and saving of XML files as special "presets" to be applied to a new install of Moodle for specific situations.
*An interface listing the templates (XML exported files with the "template" attribute set)
*An interface listing the presets (XML exported files with the "preset" attribute set)
*A way to record the registered templates (beyond detecting the filesystem)
*A way to record the registered presets (beyond detecting the filesystem)
*A view of the settings available for restore in a given XML file
*A view of the settings available for restore in a given XML file
*Partial export/import
*Partial export/import
Line 24: Line 26:
*Logging the settings (to allow rollbacks)
*Logging the settings (to allow rollbacks)
*Comments for settings changes
*Comments for settings changes
*The ability to "switch" a template on/off. While on, it overrides the original settings without replacing them. When off, the original settings are restored
*The ability to "switch" a preset on/off. While on, it overrides the original settings without replacing them. When off, the original settings are restored
*In addition to the previous point: ability to switch several templates on/off, and to organise them by priority. If a setting is defined in two templates, the one in the template with the highest priority overrides the other one.
*In addition to the previous point: ability to switch several presets on/off, and to organise them by priority. If a setting is defined in two presets, the one in the preset with the highest priority overrides the other one.
*Progressive disclosure (making sure that only those who want to mess with the templates will find them, and that they will not be changed accidentally) [http://www.useit.com/alertbox/progressive-disclosure.html]
*Progressive disclosure (making sure that only those who want to mess with the presets will find them, and that they will not be changed accidentally) [http://www.useit.com/alertbox/progressive-disclosure.html]


==Glossary==
==Glossary==
{| class="nicetable"
{| class="wikitable"
!Term
!Term
!Definition
!Definition
|-
|-
|Preview
|Preview
|The ability to see the contents of a template before applying it (either all the settings, or the settings that will be changed)
|The ability to see the contents of a preset before applying it (either all the settings, or the settings that will be changed)
|-
|-
|Settings tree
|Settings tree
|A tree containing all Moodle settings in the same organization as the site administration page
|A tree containing all Moodle settings in the same organization as the site administration page
|-
|-
|Template
|Preset
|An XML file containing either full or partial Moodle settings.
|An XML file containing either full or partial Moodle settings.
|-
|-
|Template
|The old name for presets; this may be found in other pages talking about this project.
|}
|}


== UI Mockups ==
== UI Mockups ==
===Settings Template Creation===
===Settings preset Creation===


[[Image:Settingsmockup1.png]]
[[Image:Settingsmockup1.png]]
All settings are available in the tree, organized in a similar fashion as the admin navbar. Checking a setting includes it in your template. The checkbox at the bottom allows you to automatically exclude sensitive settings (like passwords). Saving a template creates the XML file, and adds the file to the list of available templates.


===Applying Settings Templates===
All settings are available in the tree, organized in a similar fashion as the admin navbar. Checking a setting includes it in your preset. The checkbox at the bottom allows you to automatically exclude sensitive settings (like passwords). Saving a preset creates the XML file, and adds the file to the list of available presets.
 
===Applying Settings presets===
[[Image:Settingsmockup2.png]]
[[Image:Settingsmockup2.png]]
The debug window at the top only appears when templates have been applied. It shows which setting was taken from which template, as well as any possible errors. Beneath it is a list of available templates (with an option to import from file). There is a checkbox that determines whether to use the default or current value for unspecified settings, but we will probably end up with more user-controlled parameters for importing. You can preview a template, bringing up the screen below. The "Use Multiple" button is an advanced feature, allowing you to choose multiple templates and sort them by priority. You can also create a new template from multiple separate templates.


===Settings Template Preview===
The debug window at the top only appears when presets have been applied. It shows which setting was taken from which preset, as well as any possible errors. Beneath it is a list of available presets (with an option to import from file). There is a checkbox that determines whether to use the default or current value for unspecified settings, but we will probably end up with more user-controlled parameters for importing. You can preview a preset, bringing up the screen below. The "Use Multiple" button is an advanced feature, allowing you to choose multiple presets and sort them by priority. You can also create a new preset from multiple separate presets.
 
===Settings preset Preview===
[[Image:Settingsmockup3.png]]
[[Image:Settingsmockup3.png]]


It allows users to collapse and expand the sub categories, view the values that are specified, as well as seeing setting descriptions. I hope to include an editor that looks similar to this, except with the ability to change the specified value (this would edit the XML file, not the site settings).
It allows users to collapse and expand the sub categories, view the values that are specified, as well as seeing setting descriptions. I hope to include an editor that looks similar to this, except with the ability to change the specified value (this would edit the XML file, not the site settings).


==Use Cases==
===UC006-1 Creating a new preset===
*User clicks "Create preset" in Admin Preset block, goes to preset creation page
*User selects which settings to include in the preset. This is done via an expandable tree that mirrors the existing admin tree. Checking a box next to setting saves the setting in a preset, and checking a category checks all the settings within it.
*User chooses a name for the preset and clicks "save."
Pre:
*User has admin permissions.
Post:
*XML presets file is created with selected settings.
*File is added to the list of available presets.
===UC006-2 Applying existing preset(s)===
*User clicks "apply presets" in admin preset block,
*User is presented with list of available presets, and selects the ones they want to apply
*User adjusts the priority of each selected preset by ordering them
*User clicks "apply presets"
Pre:
*User-created preset exists
*User has admin permissions
Post:
*Moodle goes through the presets in order and applies them.
*Each setting says which preset affected it.
*User sees a summary of what settings were affected
===UC006-3 Rolling back settings===
*User clicks "roll back settings" in admin preset block
*User sees last x days of logged settings changes in list form (x is a user-specified setting)
*User selects the item in the list that they want to revert to.
*User clicks "apply"
Pre:
*Site has settings backup enabled
*User has admin permissions
Post:
*Moodle goes backwards through the log and undoes all the changes through the revert point.
*All log entries after the revert point are deleted.
===UC006-4 Previewing a preset===
*User clicks "Manage/edit presets"
*User sees a list of presets, can click "View XML" to preview a preset in its raw form.
*Clicking "Preview" will take user to an admin settings page showing all the settings included in a preset. This page would look mostly like current settings pages (except maybe with a "Preview" banner overlaid)
Pre:
*User-created preset exists
*User has admin permissions


== TODO ==
== TODO ==
===UI Mockup===
Revise the UI mockup until it accounts for all decided upon features. Put this mockup on the tracker so that other users can critique and revise it. This will involve simulating and creating flowcharts for typical workflows involving settings import/explort.


===Coding===
===Coding===
Line 73: Line 129:
*Import partial configuration
*Import partial configuration
*Settings preview
*Settings preview
*Import multiple templates
*Import multiple presets
*XML/template editor
*XML/preset editor

Latest revision as of 13:23, 14 July 2021

GSOC '09 This project will create a administrative interface for importing and exporting site-wide configurations. These settings can be applied either individually or with specified priorities.


Motivation

I want to create a new administrative interface for importing and exporting site-wide configuration (tracker issue MDL-18548). At the basic level, it would allow administrators to save their site settings in an XML file, as well as import other saved configurations. Administrators will be able to select a subset of all settings to create a preset. They can then apply presets to their site settings, either individually or with specified priorities. Moodle will then adjust change setting to the value in the highest-priority preset, and then use either the current or default settings for whatever remains.

Other Discussion

Related Documentation

User Requested Features

This is a current list of features that have been suggested/requested. This is not the finalized list and will need a community review:

  • Selection of settings to export (grouped in a tree format as displayed in the administrator panel)
  • Naming and saving of XML files as special "presets" to be applied to a new install of Moodle for specific situations.
  • An interface listing the presets (XML exported files with the "preset" attribute set)
  • A way to record the registered presets (beyond detecting the filesystem)
  • A view of the settings available for restore in a given XML file
  • Partial export/import
  • Compatibility with installation
  • Logging the settings (to allow rollbacks)
  • Comments for settings changes
  • The ability to "switch" a preset on/off. While on, it overrides the original settings without replacing them. When off, the original settings are restored
  • In addition to the previous point: ability to switch several presets on/off, and to organise them by priority. If a setting is defined in two presets, the one in the preset with the highest priority overrides the other one.
  • Progressive disclosure (making sure that only those who want to mess with the presets will find them, and that they will not be changed accidentally) [1]

Glossary

Term Definition
Preview The ability to see the contents of a preset before applying it (either all the settings, or the settings that will be changed)
Settings tree A tree containing all Moodle settings in the same organization as the site administration page
Preset An XML file containing either full or partial Moodle settings.
Template The old name for presets; this may be found in other pages talking about this project.

UI Mockups

Settings preset Creation

Settingsmockup1.png

All settings are available in the tree, organized in a similar fashion as the admin navbar. Checking a setting includes it in your preset. The checkbox at the bottom allows you to automatically exclude sensitive settings (like passwords). Saving a preset creates the XML file, and adds the file to the list of available presets.

Applying Settings presets

Settingsmockup2.png

The debug window at the top only appears when presets have been applied. It shows which setting was taken from which preset, as well as any possible errors. Beneath it is a list of available presets (with an option to import from file). There is a checkbox that determines whether to use the default or current value for unspecified settings, but we will probably end up with more user-controlled parameters for importing. You can preview a preset, bringing up the screen below. The "Use Multiple" button is an advanced feature, allowing you to choose multiple presets and sort them by priority. You can also create a new preset from multiple separate presets.

Settings preset Preview

Settingsmockup3.png

It allows users to collapse and expand the sub categories, view the values that are specified, as well as seeing setting descriptions. I hope to include an editor that looks similar to this, except with the ability to change the specified value (this would edit the XML file, not the site settings).

Use Cases

UC006-1 Creating a new preset

  • User clicks "Create preset" in Admin Preset block, goes to preset creation page
  • User selects which settings to include in the preset. This is done via an expandable tree that mirrors the existing admin tree. Checking a box next to setting saves the setting in a preset, and checking a category checks all the settings within it.
  • User chooses a name for the preset and clicks "save."

Pre:

  • User has admin permissions.

Post:

  • XML presets file is created with selected settings.
  • File is added to the list of available presets.

UC006-2 Applying existing preset(s)

  • User clicks "apply presets" in admin preset block,
  • User is presented with list of available presets, and selects the ones they want to apply
  • User adjusts the priority of each selected preset by ordering them
  • User clicks "apply presets"

Pre:

  • User-created preset exists
  • User has admin permissions

Post:

  • Moodle goes through the presets in order and applies them.
  • Each setting says which preset affected it.
  • User sees a summary of what settings were affected

UC006-3 Rolling back settings

  • User clicks "roll back settings" in admin preset block
  • User sees last x days of logged settings changes in list form (x is a user-specified setting)
  • User selects the item in the list that they want to revert to.
  • User clicks "apply"

Pre:

  • Site has settings backup enabled
  • User has admin permissions

Post:

  • Moodle goes backwards through the log and undoes all the changes through the revert point.
  • All log entries after the revert point are deleted.


UC006-4 Previewing a preset

  • User clicks "Manage/edit presets"
  • User sees a list of presets, can click "View XML" to preview a preset in its raw form.
  • Clicking "Preview" will take user to an admin settings page showing all the settings included in a preset. This page would look mostly like current settings pages (except maybe with a "Preview" banner overlaid)

Pre:

  • User-created preset exists
  • User has admin permissions

TODO

Coding

Each feature will be given its own issue in the tracker. Tentative tracker issue list.

  • Basic export of all settings
  • Basic import of all settings
  • Select settings to export
  • Import partial configuration
  • Settings preview
  • Import multiple presets
  • XML/preset editor