Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Backup
    • Labels:
      None
    • Database:
      MySQL
    • Difficulty:
      Difficult
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      32805

      Description

      When backing up a course, say course "Mycourse" the process brings user in a very cool step by step interface. Once the backup is completed, user see a page where the backup file is shown.

      Breadcrumb show the path Moodlehome->Courses->Mycourse->Files

      The page show a path Mycourse / Course backups and the backup file just below. However, if user navigates elsewhere, there is no easy way to return back to the page where backup files are listed. Not sure if it is intended or I'm missing something really big somewhere....

      1. restore_pre_ui.patch
        17 kB
        Dongsheng Cai
      2. Sample restore interface.bmml
        5 kB
        Martin Dougiamas
      1. Sample restore interface.png
        84 kB

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi,

          well, if you go to the "files" link in the block... you should see there the "Course backups" folder.

          Also, note that, once available, the "Restore" link, will direct you to that "Course backups" folder.

          So perhaps it's only a matter of having the restore link working?

          About the breadcrumb / path... I really don't know which one is the idea there. But, in any case it should be something "consistent" with other areas.

          Just adding Dong and Martin here to see what is the idea for those breadcrumbs / paths.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Hi, well, if you go to the "files" link in the block... you should see there the "Course backups" folder. Also, note that, once available, the "Restore" link, will direct you to that "Course backups" folder. So perhaps it's only a matter of having the restore link working? About the breadcrumb / path... I really don't know which one is the idea there. But, in any case it should be something "consistent" with other areas. Just adding Dong and Martin here to see what is the idea for those breadcrumbs / paths. Ciao
          Hide
          Martin Dougiamas added a comment -

          HI,

          The display of the Files area is pretty much final now (Dongsheng just worked on it). It's really just to let you browse the files and click/download.

          For restore, people won't generally go there at all.

          We need a new "Select file to restore" page that shows:

          1) A filepicker, so people can select a file from any repository, or upload them.
          2) A list of all the files in "Course backups" in the current course so people can select one of those easily. Note these are also available via 1 above, but could be harder to find.

          Show
          Martin Dougiamas added a comment - HI, The display of the Files area is pretty much final now (Dongsheng just worked on it). It's really just to let you browse the files and click/download. For restore, people won't generally go there at all. We need a new "Select file to restore" page that shows: 1) A filepicker, so people can select a file from any repository, or upload them. 2) A list of all the files in "Course backups" in the current course so people can select one of those easily. Note these are also available via 1 above, but could be harder to find.
          Hide
          Martin Dougiamas added a comment -

          Added UI Mockup: <Sample restore interface>

          Show
          Martin Dougiamas added a comment - Added UI Mockup: <Sample restore interface>
          Hide
          Andrea Bicciolo added a comment -

          Eloy, Martin,
          thanks for your comments. I'm testing using Moodle 2.0 Preview 3 (Build: 20100623), in the course page there are no "File" link in the course "Setting" block, nor in navigation, I'm probably missing something or Dongsheng should commit it into CVS? I see Repositories link available if any course repo is active.

          Show
          Andrea Bicciolo added a comment - Eloy, Martin, thanks for your comments. I'm testing using Moodle 2.0 Preview 3 (Build: 20100623), in the course page there are no "File" link in the course "Setting" block, nor in navigation, I'm probably missing something or Dongsheng should commit it into CVS? I see Repositories link available if any course repo is active.
          Hide
          Martin Dougiamas added a comment -

          No, there is only a Files link for upgraded 1.9 courses that have some course files there, and it's read-only.

          New Moodle 2.0 courses don't show the link at all, there is nothing to show in there (except backups, and that's addressed with the restore page).

          Show
          Martin Dougiamas added a comment - No, there is only a Files link for upgraded 1.9 courses that have some course files there, and it's read-only. New Moodle 2.0 courses don't show the link at all, there is nothing to show in there (except backups, and that's addressed with the restore page).
          Hide
          Martin Dougiamas added a comment -

          Dongsheng, can you produce a simple page that implements this interface and attach it here so Eloy can drop it straight into restore?

          Unfortunately don't think we can use the filetree renderer for the top bit, as we need the extra info there. A simple table would be fine though.

          Eloy, what should the location of this page be? /course/restore.php?id=5 or /backup/restoreselect.php?courseid=5 ?

          Show
          Martin Dougiamas added a comment - Dongsheng, can you produce a simple page that implements this interface and attach it here so Eloy can drop it straight into restore? Unfortunately don't think we can use the filetree renderer for the top bit, as we need the extra info there. A simple table would be fine though. Eloy, what should the location of this page be? /course/restore.php?id=5 or /backup/restoreselect.php?courseid=5 ?
          Hide
          Dongsheng Cai added a comment -

          Eloy, can you please the location of this page? So I can attach a patch for it, thanks.

          Show
          Dongsheng Cai added a comment - Eloy, can you please the location of this page? So I can attach a patch for it, thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Changing name to restore: pre-ui

          Show
          Eloy Lafuente (stronk7) added a comment - Changing name to restore: pre-ui
          Hide
          Eloy Lafuente (stronk7) added a comment -

          So, quick notes about the selection/upload of backup files and so on (named, since now, the restore pre-ui).

          This restore pre-ui must be responsible, IMO, of a bunch of tasks (none of them implemented in the restore process at all). Here is one list:

          1) Pick one backup file (from repo, from file browser...). By default I think that the list to be shown is the list of files present in the context the user selects "restore" (course/activity/user). But the UI must allow the user to quick switch to other contexts. I really know nothing about the file manager/browser/repos stuff, so I cannot comment about implementation details too much. But, in my mind, each "restore" link must display the files available in that area. Or upload (and download) new files to it if the user has perms.

          2) Once one file is picked, it's moved to one "xxxxxx" directory under CFG->dataroot/temp/backup and unzipped there. Note there is one restore_controller::get_tempdir_name() method available to generate correct "xxxxxx" names.

          3) If possible, one page showing the main info for that backup is displayed (much like the 1.9 restore).

          ==== And here the complex things begin!

          The restore pre-ui is also responsible for allowing the user to specify the target of the restore operation. And this is a complex thing. It must support different alternatives like:

          a) new course, existing course, current course.
          b) deleting info or adding info.
          c) pickup category when new course is selected
          d) pickup course when existing is selected
          e) keep current course (the one we have ignited the restore operation from)
          f) delete course contents when one of the "deleting" options is selected.
          g) do all this in an "secure way", checking for permission for each of the options/categories/courses.

          I know it sounds like a complex thing, but all that is implemented in restore 1.9, so perhaps, the first step is to see all the possibilities working in one 1.9 site, with various categories/courses, as admin and teacher with different permissions.

          At the end, all the restore process needs is:

          • One target courseid where the restore will happen.
          • One target mode (see the backup::TARGET_xxxx constants in backup.class.php) to let the process know how to present some settings/execute some steps.

          Let's comment. But plz, first, take a look to 1.9 restore with detail, I'm sure it will make things easier to discuss.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - So, quick notes about the selection/upload of backup files and so on (named, since now, the restore pre-ui). This restore pre-ui must be responsible, IMO, of a bunch of tasks (none of them implemented in the restore process at all). Here is one list: 1) Pick one backup file (from repo, from file browser...). By default I think that the list to be shown is the list of files present in the context the user selects "restore" (course/activity/user). But the UI must allow the user to quick switch to other contexts. I really know nothing about the file manager/browser/repos stuff, so I cannot comment about implementation details too much. But, in my mind, each "restore" link must display the files available in that area. Or upload (and download) new files to it if the user has perms. 2) Once one file is picked, it's moved to one "xxxxxx" directory under CFG->dataroot/temp/backup and unzipped there. Note there is one restore_controller::get_tempdir_name() method available to generate correct "xxxxxx" names. 3) If possible, one page showing the main info for that backup is displayed (much like the 1.9 restore). ==== And here the complex things begin! The restore pre-ui is also responsible for allowing the user to specify the target of the restore operation. And this is a complex thing. It must support different alternatives like: a) new course, existing course, current course. b) deleting info or adding info. c) pickup category when new course is selected d) pickup course when existing is selected e) keep current course (the one we have ignited the restore operation from) f) delete course contents when one of the "deleting" options is selected. g) do all this in an "secure way", checking for permission for each of the options/categories/courses. I know it sounds like a complex thing, but all that is implemented in restore 1.9, so perhaps, the first step is to see all the possibilities working in one 1.9 site, with various categories/courses, as admin and teacher with different permissions. At the end, all the restore process needs is: One target courseid where the restore will happen. One target mode (see the backup::TARGET_xxxx constants in backup.class.php) to let the process know how to present some settings/execute some steps. Let's comment. But plz, first, take a look to 1.9 restore with detail, I'm sure it will make things easier to discuss. Ciao
          Hide
          Martin Dougiamas added a comment -

          That all makes sense to me, thanks Eloy! (And congrats on getting the basic core code in!)

          Dongsheng, can you make this your next priority after whatever you're finishing now?

          Show
          Martin Dougiamas added a comment - That all makes sense to me, thanks Eloy! (And congrats on getting the basic core code in!) Dongsheng, can you make this your next priority after whatever you're finishing now?
          Hide
          Dongsheng Cai added a comment -

          Restore pre ui

          After the discussion yesterday, the confirm page (the overview info of backup file) will be implmented in restore_control process, the pre-ui will be used to pick file then move it to temp dir only.

          NOTE:
          I cannot reuse the file tree renderer component in core, because backup file tree have different behavior, so I created another one with extra js here.

          Show
          Dongsheng Cai added a comment - Restore pre ui After the discussion yesterday, the confirm page (the overview info of backup file) will be implmented in restore_control process, the pre-ui will be used to pick file then move it to temp dir only. NOTE: I cannot reuse the file tree renderer component in core, because backup file tree have different behavior, so I created another one with extra js here.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Uhm, in restore_control(er) ? I guess things can be moved between pre_ui and ui, but not to controller itself (mainly because restore_controller is, by definition, UI independent, so can be executed without any UI).

          Already have chatted with MD, it's oki to move things from pre_ui to ui but, as said, not introducing any UI dependency in the controller. All you will find limits, like the need to know the target courseid BEFORE instantiating the restore_controller.

          So I'm not sure if the ui (that needs controller) is the place to put that.... ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Uhm, in restore_control(er) ? I guess things can be moved between pre_ui and ui, but not to controller itself (mainly because restore_controller is, by definition, UI independent, so can be executed without any UI). Already have chatted with MD, it's oki to move things from pre_ui to ui but, as said, not introducing any UI dependency in the controller. All you will find limits, like the need to know the target courseid BEFORE instantiating the restore_controller. So I'm not sure if the ui (that needs controller) is the place to put that.... ciao
          Hide
          Dongsheng Cai added a comment -

          Eloy, sorry, I shouldn't say restore_controller, I mean restore_ui_controller, the ui tracking progress of restoring.

          Show
          Dongsheng Cai added a comment - Eloy, sorry, I shouldn't say restore_controller, I mean restore_ui_controller, the ui tracking progress of restoring.
          Hide
          Sam Hemelryk added a comment -

          Hi Dongsheng,

          How is this coming along, any chances it can be commit shortly?

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Dongsheng, How is this coming along, any chances it can be commit shortly? Cheers Sam
          Hide
          Dongsheng Cai added a comment -

          pre-ui committed, please comment if it has any problems

          Show
          Dongsheng Cai added a comment - pre-ui committed, please comment if it has any problems
          Hide
          Dongsheng Cai added a comment -

          committed

          Show
          Dongsheng Cai added a comment - committed
          Hide
          Dongsheng Cai added a comment -

          re-open it to:

          • add capability check to filepicker button
          • display user backup files in the treeview
          Show
          Dongsheng Cai added a comment - re-open it to: add capability check to filepicker button display user backup files in the treeview
          Hide
          Dongsheng Cai added a comment -

          user backup area added
          restore:uploadfile cap is taken into account

          Show
          Dongsheng Cai added a comment - user backup area added restore:uploadfile cap is taken into account

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: