Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: File system repository.

File system repository: Difference between revisions

From MoodleDocs
m (removing update template because the page is fine as it is ;-))
 
(43 intermediate revisions by 8 users not shown)
Line 1: Line 1:
==How to use the filesystem as a repository==
{{Repositories}}
The file system repository allows users within Moodle to access files which have been uploaded via FTP into designated folders on the server.  A file system repository may be available site wide for everyone; within an individual course or for an individual user.(However - see this [http://tracker.moodle.org/browse/MDL-28656  tracker entry] regarding course and individual repositories)


This module allows you to share any of the sub-directories found in $CFG->dataroot/repository as a browseable repository inside Moodle.
This must be done by a systems admin who  has write permissions to the server directories.


It needs to be configured by a system administrator, because it requires write access to the system disk.
=== Creating  folders for your file system repositories===
*Find the moodledata folder on the server
*Inside it, create a folder  called "repository"
*Inside that folder, create as many folders as you need, named appropriately.
[[File:Moodledatarepo2.png]]
*FTP into the appropriate folder the files you want. (The folders can hold all types of files)


=== Enabling the File System repository plugin===


===1. Create some folders to be repositories===
*Go to ''Settings > Site administration > Plugins > Repositories > Manage Repositories'';
*Select from the drop down next to File sytem "Enabled and visible"
[[File:Filesystemrepo.png]]


Inside your "Moodledata" directory (the one where all your data is stored), create one called "repository".


Inside that, make one folder for each repository you want to create.  Short, simple, one-word names are best, I'm going to use "clipart" as my example.
===Setting up a site-wide file system repository===
*Once the repository is enabled as above, click on the  "Settings" link to the right.
*Scroll down to Repositories instances of the site
*Click Create a repository instance
[[File:Sitefilesystemrepo.png]]
*Give it a name and (if there are several folders on the server) choose from the dropdown the one you want. Click save
[[File:Namedfilesystem.png]]
*It will now be available in the file picker in all courses.
''NOTE: Just repeat the process to get more than one site wide file system repository''


Inside your "clipart" folder put your files (in this example it could be hundreds of useful images that you got from [http://www.openclipart.org/ openclipart.org]).
===Setting up a repository inside a course===
''NOTE:  A regular user needs to have been given permission to do this by admin (MORE DETAILS SOON)''
*Go to the desired course and click on “repositories” in the administration block
*Scroll down and click "Create File System instance"
[[File:Courseinstance.png]]
*Follow the same process as [[#Setting_up_a_site-wide_file_system_repository|here]]


Note that these directories can be ANYTHING your operating system supports.  You could mount a whole hard drive there, or mount a shared Windows network drive via SAMBA.  You could have a symbolic link to a directory that allows FTP access. The sky is the limit here for a creative Moodle admin!!
===Setting up an individual file system repository instance===
''NOTE: A regular user needs to have been given permission to do this by admin (MORE DETAILS SOON)
''
*In the navigation block, click on “my profile”
*Click on “repositories”
*Scroll down and click “create File System instance”
*Follow the same process as [[#Setting_up_a_site-wide_file_system_repository|here]]
*This will create a personal file system repository connecting just you to a folder on the server.
[[File:Privaterepo2.png]]


===2. Enable the File System repository plugin===
===Using it===
If you try to add a file in Moodle, then the File Picker should show you your new file system repository, and you should be able to browse it and select files to use. 


You do this in the Settings block, under Site Administration > Plugins > Repositories > Manage repositories.
Note that file types are respected (based on file extensions), so if you are adding an image in the editor, then you won't see Office docs (for example) appear in the File Picker.
 
Once enabled, click on the "Settings" link beside it.
 
===3. (Optional) Set up the personal repositories===
 
You can safely ignore the settings at the top.  These are for rare cases where you want to allow users to create their own virtual repositories from the filesystem, either for themselves or a course.
 
===4. Create some actual usable repositories (instances)===
 
# Click on "Add a repository instance".
# Give it a name.  This is how it will appear in the filepicker interface in the list on the left.
# Choose the appropriate subdirectory from the list.
 
===5. Check permissions===
 
Although permissions should be on by default, you may have to check the roles and make sure that the "Authenticated User" role (or some other role, if you have set up a special one) has the "repository/filesystem:view" capability allowed. 
 
(If you are using 2.0 Preview 1 then this was not on by default)
 
===6. Use it!===


Everything should be working.  If you try to add a file in Moodle, then the File Picker should show you your new file system repository, and you should be able to browse it and select files to use.
[[File:Filesystemeg.png]]


Note that file types are respected (based on file extensions), so if you are adding an image in the editor, then you won't see Office docs (for example) appear in the File Picker.
==Repository permissions==


[[Image:Repository-filesystem-filepicker.png]]
This repository is accessible by default to administrators, course creators, teachers, editing teachers and managers, but not to guests or students. This [[Capabilities/repository/filesystem:view|capability]] can be changed to control access to users with specific roles.


==See also==
==See also==
 
*[[File_system_repository_FAQ|File system repository FAQ]]
* Overview of [[Repositories|Repositories]]
* [http://moodle.drupalgardens.com/article/tue-06152010-1918/ftp-files-moodle-20-repository-api FTP files into Moodle 2.0 with the repository API article from moodle.drupalgardens.com] including screencast
* [http://moodle.drupalgardens.com/article/tue-06152010-1918/ftp-files-moodle-20-repository-api FTP files into Moodle 2.0 with the repository API article from moodle.drupalgardens.com] including screencast
* MDL-28656 "File system settings need clarification" tracker issue


[[Category:Repositories]]
[[Category:Site administration]]
[[de:Dateisystem-Repository]]
[[de:Dateisystem-Repository]]

Latest revision as of 08:25, 5 November 2012

The file system repository allows users within Moodle to access files which have been uploaded via FTP into designated folders on the server. A file system repository may be available site wide for everyone; within an individual course or for an individual user.(However - see this tracker entry regarding course and individual repositories)

This must be done by a systems admin who has write permissions to the server directories.

Creating folders for your file system repositories

  • Find the moodledata folder on the server
  • Inside it, create a folder called "repository"
  • Inside that folder, create as many folders as you need, named appropriately.

Moodledatarepo2.png

  • FTP into the appropriate folder the files you want. (The folders can hold all types of files)

Enabling the File System repository plugin

  • Go to Settings > Site administration > Plugins > Repositories > Manage Repositories;
  • Select from the drop down next to File sytem "Enabled and visible"

Filesystemrepo.png


Setting up a site-wide file system repository

  • Once the repository is enabled as above, click on the "Settings" link to the right.
  • Scroll down to Repositories instances of the site
  • Click Create a repository instance

Sitefilesystemrepo.png

  • Give it a name and (if there are several folders on the server) choose from the dropdown the one you want. Click save

Namedfilesystem.png

  • It will now be available in the file picker in all courses.

NOTE: Just repeat the process to get more than one site wide file system repository

Setting up a repository inside a course

NOTE: A regular user needs to have been given permission to do this by admin (MORE DETAILS SOON)

  • Go to the desired course and click on “repositories” in the administration block
  • Scroll down and click "Create File System instance"

Courseinstance.png

  • Follow the same process as here

Setting up an individual file system repository instance

NOTE: A regular user needs to have been given permission to do this by admin (MORE DETAILS SOON)

  • In the navigation block, click on “my profile”
  • Click on “repositories”
  • Scroll down and click “create File System instance”
  • Follow the same process as here
  • This will create a personal file system repository connecting just you to a folder on the server.

Privaterepo2.png

Using it

If you try to add a file in Moodle, then the File Picker should show you your new file system repository, and you should be able to browse it and select files to use.

Note that file types are respected (based on file extensions), so if you are adding an image in the editor, then you won't see Office docs (for example) appear in the File Picker.

Filesystemeg.png

Repository permissions

This repository is accessible by default to administrators, course creators, teachers, editing teachers and managers, but not to guests or students. This capability can be changed to control access to users with specific roles.

See also