2.3. Resources and repository

Summary

The repository is found in OLAT under Learning resources and lists repository entries. These entries are meta information about a contained resource, typically a file. Each resource has an associated handler responsible for implementing the behaviour of the possible actions.

This is working in the same fashion as the filetypes - application association in a browser or a modern operating system. See Figure 2.1, “How the repository looks.” for an example repository listing. The type - handler mechanism is more detailed described in the section called “Types and repositoryhandlers” , and a description of the actions can be found in the section called “Workflows”

Figure 2.1. How the repository looks.

How the repository looks.


Types and repositoryhandlers

First of all the RepositoryHandlerFactory is the central point where the implementations of the RepositoryHandlers are subscribed for the types they claim. By design the type should be the string returned from the OLATResourcable.getResourceableTypeName() .

All resources in the repository refer to a file so far, but the type - handler mechanism is restricted by no means to files. The following table maps file resources and their suffixes to the corresponding handler.

The file validating class is used to check whether a certain file or archive is valid. The Handler class is responsible for a starting point of GUI workflows for the corresponding file or archive. It inform the RepositoryHandlerFactory about possible actions (see the section called “Workflows”) and which types it handles.

Table 2.1. Repository file validating classes, suffixes and handlers

File Validating ClassSuffixes/TypeHandler classComment
FileResource *WebDocumentHandler

A generic file resource for files not categorized by the above.

AnimationFileResource SWFWebDocumentHandler 
OLAT Course CourseModule.ORES_TYPE_COURSE CourseHandler

The OLAT course is a ZIP file containing a runstructure.xml, editortree.xml and linked other resources like tests, surveys.

DocFileResource DOCWebDocumentHandler 
GlossaryResource ZIP GlossaryHandler Archive must contain either a glossary.xml or a glossary.textmarker.xml
ImageFileResource JPG, JPEG, GIF, TIFF, IMG, BMP, PBM, ICO, PICT, PNGWebDocumentHandler 
ImsCPFileResource ZIPImsCPHandler

the extracted archive must contain the imsmanifest.xml which must validate.

MovieFileResource

MPG, MPEG, QT, RM, RAM, AVI

WebDocumentHandler 
PdfFileResource PDFWebDocumentHandler 
PowerpointFileResource

PPT, PPS

WebDocumentHandler 
ScormCPFileResource ZIPSCORMCPHandler

the extracted archive must contain the imsmanifest.xml which must validate.

SharedFolderFileResource FileResource.SHAREDFOLDER SharedFolderHandlerComment
SoundFileResource

MP3, WAV, RA, MIDI

WebDocumentHandler 
SurveyFileResource ZIPQTISurveyHandler

the extracted archive must contain the qti.xml which must validate.

TestFileResource ZIPQTITestHandler

the extracted archive must contain the qti.xml which must validate.

WikiResource ZIPWikiHandlerZIP File is scanned for a index file.
XlsFileResource XLSWebDocumentHandler 


Workflows

Managing the repository involves adding, creating new resources, removing existing ones and update the meta information of a repository entry. Adding involves either uploading a file resource or selecting one from the various folder places. Creating is typically only possible if OLAT offers the appropriate editor.

Figure 2.2. The actions on the repository.

The actions on the repository.


The concrete implementation of the RepositoryHandler, i.e. WebDocumentHandler, must provide a controller for adding the given resource. This controller is returned when the getAddController(..) method is called.

Before a deletion is issued the handler of the respective resource is asked if the resource is readyToDelete(..). The deletion is initiated by cleanUpOnDelete(..) which is expected to do any work necessary, before removing the resource definitively.

Similiar to the adding of a resource, the handler also may provide the facility to create or edit the resources meta information. This is the so called details view and a component for this can be provided in the method getDetailsComponent(..).

Figure 2.3. How the repository looks.

How the repository looks.