Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

File system repository: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
(copied from 2.4 docs)
 
(63 revisions intermèdies per 6 usuaris que no es mostren)
Línia 1: Línia 1:
{{Repositories}}
{{Repositories}}
<p class="note">'''Please refer to [[Page_notes#File system repository configuration|these notes]] before editing this page.'''</p>
The file system repository allows access to files which have been uploaded (e.g. via FTP) into designated folders on the server. ''(Note that these folders are '''not''' created inside  the Moodle site, but on the server where Moodle is hosted.)''


==How to use the filesystem as a repository==
A file system repository may be available site wide for everyone or  within an individual course (set up by admin) or for an individual administrator. See MDL-28656 regarding course and individual repository configuration.


This module allows you to share any of the sub-directories found in $CFG->dataroot/repository as a browseable repository inside Moodle.


It needs to be configured by a system administrator, because it requires write access to the system disk.
This must be done by a systems admin who has write permissions to the server directories.


Here is [http://moodle.drupalgardens.com/article/tue-06152010-1918/ftp-files-moodle-20-repository-api a video] that may be helpful.
When a file from the file system repository is re-used elsewhere on Moodle, the teacher has the option to make a copy (a new, unconnected version) or to create a shortcut or alias. See [[Working with files]] for more details.


===1. Create some folders to be repositories===
Once a repository has been created and files uploaded to it, the files can be made available within the file picker for use within a course. There are several steps to take to implement this feature:-


Inside your "Moodledata" directory (the one where all your data is stored), create one called "repository".
These must be done by a systems admin who  has write permissions to the server directories and admin permissions within Moodle.


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.
==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.


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]).
{|
| [[File:filesystemonserver.png|thumb|250px|Creating repositories on the server]]
|}


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!!
*Copy into the appropriate folder the files you want (using FTP, SFTP, shared folder etc.). (The folders can hold all types of files)


===2. Enable the File System repository plugin===
== Enabling the File System repository plugin==
*Go to ''Settings > Site administration > Plugins > Repositories > Manage Repositories'';
*Select from the drop down next to File system "Enabled and visible"


You do this in the Settings block, under Site Administration > Plugins > Repositories > Manage repositories >File system.  
{|
| [[File:filesystemrepo23.png|thumb|350px|Enabling the file system repository]]
|}
*Click the '''Settings''' link..


Once enabled, click on the "Settings" link beside it.
==Setting up a site-wide file system repository==
Having clicked the "Settings" link as above:
*Scroll down to Repositories instances of the site
*Click ''Create a repository instance''
*Give it a name and (if there are several folders on the server) choose from the dropdown the one you want. Click '''Save.'''
*It will now be available in the file picker in all courses.


Alternatively, you will now see "File system" in the list of links in Plugins > Repositories. Click on this link, will also take you to the settings page.
{|
| [[File:createinstance23.png|thumb|Creating a new file system repository]]
| [[File:setuprepo23.png|thumb|Selecting and naming the repository]]
|}


===3. (Optional) Set up the personal repositories===
Still in the File system settings page:
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)===
''NOTE: Just repeat the process to get more than one site wide file system repository''
In settings at the bottom of the page
# Click on "Add a repository instance".
# Give it a name.  The name will display in the [[File picker]] interface  with the other repository areas.
# Choose the appropriate subdirectory from the list.
# Click save


===5. Check permissions===
==Setting up a repository inside a course==
''NOTE only Moodle admins can do this''


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. 
Enable repositories as in the instructions above. On the Settings page:
*Check the top box allowing users to add a repository instance to the course (1 below)
*Go to the desired course and click on “repositories” in the administration block(2 below)
*Scroll down and click "Create File System instance" (3 below)


(If you are using 2.0 Preview 1 then this was not on by default)


===6. Use it!===
{|
| [[File:courseinstancerepo.png|thumb|1:Enable course repositories]]
| [[File:coursesettingsrepo1.png|thumb|2:Click "Repositories" in Course admin]]
| [[File:createcourseinstance.png|thumb|3:Click to create an instance in the course]]
|}
 
*Follow the same process as [[#Setting_up_a_site-wide_file_system_repository|here]]
 
==Setting up an individual file system repository instance==
''NOTE: Only Moodle admins can do this''
 
Enable repositories as in the instructions above. On the Settings page:
*Check the top box allowing users to add a repository instance to the user context (1 below)
*In the navigation block, click on “my profile”
*Click on “Repositories” (2 below)
*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 (3 below)
 
{|
| [[File:userinstancerepo.png|thumb|1:Enable user repository instances]]
| [[File:profilerepolink.png|thumb|2:Click the Repositories link in profile]]
| [[File:userprivaterepo.png|thumb|3:Adding files from individual repository]]
|}
 
*Upload any files required by course creators to the appropriate folders
 
Server permissions  are needed here to add via FTP (or other method) the required files.
 
From this point on the check boxes need not be set - leaving them set just invites people to create a repository instance and then advises them that they do not have sufficient privilges.
 
 
===Using a File System repository file===
 
* A user  can now make use of the uploaded files by accessing the repository from within the file picker, creating a resource link to a document, for example.  This process copies the uploaded file into Moodle and students may access the resource.
 
 
{|
| [[File:newfilerepodisplay1.png|thumb|350px|Adding a file from a file system repository]]
|}


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. 


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.
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.


[[Image:Repository-filesystem-filepicker.png]]
==Repository capabilities==
 
==FAQ==
===How do the files get into the File system repository?===
#Get your person with server access to copy them in
#Set up FTP
#Set up access to that folder as a Windows share


===Is there a way to upload files to a File system repository from inside Moodle?===
There is just one capability, [[Capabilities/repository/filesystem:view|View file system repository]], which is allowed for the default authenticated user role.
If you are talking about core (vanilla) Moodle: not at the moment
This means that if a student is required to upload a file - upload assignment, for example, then the repository files may be browsed.  It may be more appropriate for this permission to be changed so that course creators have the capabilty, but not students.


==See also==
==See also==
*[[File_system_repository_FAQ|File system repository FAQ]]
* Overview of [[Repositories|Repositories]]
* 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://www.somerandomthoughts.com/blog/2010/06/15/ftp-files-into-moodle-2-0-with-the-repository-api/ FTP files into Moodle 2.0 with the repository API article from somerandomthoughts.com] including screencast


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

Revisió de 08:30, 11 juny 2013

The file system repository allows access to files which have been uploaded (e.g. via FTP) into designated folders on the server. (Note that these folders are not created inside the Moodle site, but on the server where Moodle is hosted.)

A file system repository may be available site wide for everyone or within an individual course (set up by admin) or for an individual administrator. See MDL-28656 regarding course and individual repository configuration.


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

When a file from the file system repository is re-used elsewhere on Moodle, the teacher has the option to make a copy (a new, unconnected version) or to create a shortcut or alias. See Working with files for more details.

Once a repository has been created and files uploaded to it, the files can be made available within the file picker for use within a course. There are several steps to take to implement this feature:-

These must be done by a systems admin who has write permissions to the server directories and admin permissions within Moodle.

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.
Creating repositories on the server
  • Copy into the appropriate folder the files you want (using FTP, SFTP, shared folder etc.). (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 system "Enabled and visible"
Enabling the file system repository
  • Click the Settings link..

Setting up a site-wide file system repository

Having clicked the "Settings" link as above:

  • Scroll down to Repositories instances of the site
  • Click Create a repository instance
  • Give it a name and (if there are several folders on the server) choose from the dropdown the one you want. Click Save.
  • It will now be available in the file picker in all courses.
Creating a new file system repository
Selecting and naming the repository


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

Setting up a repository inside a course

NOTE only Moodle admins can do this

Enable repositories as in the instructions above. On the Settings page:

  • Check the top box allowing users to add a repository instance to the course (1 below)
  • Go to the desired course and click on “repositories” in the administration block(2 below)
  • Scroll down and click "Create File System instance" (3 below)


1:Enable course repositories
2:Click "Repositories" in Course admin
3:Click to create an instance in the course
  • Follow the same process as here

Setting up an individual file system repository instance

NOTE: Only Moodle admins can do this

Enable repositories as in the instructions above. On the Settings page:

  • Check the top box allowing users to add a repository instance to the user context (1 below)
  • In the navigation block, click on “my profile”
  • Click on “Repositories” (2 below)
  • 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 (3 below)
1:Enable user repository instances
2:Click the Repositories link in profile
3:Adding files from individual repository
  • Upload any files required by course creators to the appropriate folders

Server permissions are needed here to add via FTP (or other method) the required files.

From this point on the check boxes need not be set - leaving them set just invites people to create a repository instance and then advises them that they do not have sufficient privilges.


Using a File System repository file

  • A user can now make use of the uploaded files by accessing the repository from within the file picker, creating a resource link to a document, for example. This process copies the uploaded file into Moodle and students may access the resource.


Adding a file from a file system repository


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 capabilities

There is just one capability, View file system repository, which is allowed for the default authenticated user role. This means that if a student is required to upload a file - upload assignment, for example, then the repository files may be browsed. It may be more appropriate for this permission to be changed so that course creators have the capabilty, but not students.

See also