org.olat.repository.handlers
Interface RepositoryHandler

All Known Implementing Classes:
BlogHandler, CourseHandler, GlossaryHandler, ImsCPHandler, PodcastHandler, QTIHandler, QTISurveyHandler, QTITestHandler, SCORMCPHandler, SharedFolderHandler, WebDocumentHandler, WikiHandler

public interface RepositoryHandler

Initial Date: Apr 5, 2004

Author:
Mike Stock Comment:

Method Summary
 LockResult acquireLock(OLATResourceable ores, Identity identity)
          Acquires lock for the input ores and identity.
 java.lang.String archive(Identity archiveOnBehalfOf, java.lang.String archivFilePath, RepositoryEntry repoEntry)
           
 boolean cleanupOnDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl)
          Called if the repository entry referencing the given Resourceable will be deleted from the repository.
 OLATResourceable createCopy(OLATResourceable res, UserRequest ureq)
          Create a copy of the given resourceable.
 IAddController getAddController(RepositoryAddCallback callback, java.lang.Object userObject, UserRequest ureq, WindowControl wControl)
          Called the repository wants to add a new resourceable of this handler's type.
 MediaResource getAsMediaResource(OLATResourceable res)
          Called if a user downloads a Resourceable that this handler can handle.
 WizardCloseResourceController getCloseResourceController(UserRequest ureq, WindowControl wControl, RepositoryEntry repositoryEntry)
           
 Component getDetailsComponent(OLATResourceable res, UserRequest ureq)
          If a handler likes to provied any details on a resourceable in the repository's details view, he may do so by providing a component that renders the details.
 Controller getEditorController(OLATResourceable res, UserRequest ureq, WindowControl wControl)
          Called if a user wants to edit a Resourceable that this handler can provide an editor for.
 MainLayoutController getLaunchController(OLATResourceable res, java.lang.String initialViewIdentifier, UserRequest ureq, WindowControl wControl)
          Called if a user launches a Resourceable that this handler can handle.
 java.util.List<java.lang.String> getSupportedTypes()
          Return the typeNames of OLATResourceable this Handler can handle.
 boolean isLocked(OLATResourceable ores)
           
 boolean readyToDelete(OLATResourceable res, UserRequest ureq, WindowControl wControl)
          Called if the repository entry referencing the given Resourceable will be deleted from the repository.
 void releaseLock(LockResult lockResult)
          Releases the lock.
 boolean supportsDownload()
          Return true if this handler supports donwloading Resourceables of its type.
 boolean supportsEdit()
          Return true if this handler supports an editor for Resourceables of its type.
 boolean supportsLaunch()
          Return true if this handler supports launching Resourceables of its type.
 

Method Detail

getSupportedTypes

java.util.List<java.lang.String> getSupportedTypes()
Return the typeNames of OLATResourceable this Handler can handle.

Returns:
List of supported types.

supportsDownload

boolean supportsDownload()
Return true if this handler supports donwloading Resourceables of its type.

Returns:
true if this handler supports donwloading Resourceables of its type.

supportsLaunch

boolean supportsLaunch()
Return true if this handler supports launching Resourceables of its type.

Returns:
true if this handler supports launching Resourceables of its type.

supportsEdit

boolean supportsEdit()
Return true if this handler supports an editor for Resourceables of its type.

Returns:
true if this handler supports an editor for Resourceables of its type.

getLaunchController

MainLayoutController getLaunchController(OLATResourceable res,
                                         java.lang.String initialViewIdentifier,
                                         UserRequest ureq,
                                         WindowControl wControl)
Called if a user launches a Resourceable that this handler can handle.

Parameters:
res -
initialViewIdentifier - if null the default view will be started, otherwise a controllerfactory type dependant view will be activated (subscription subtype)
ureq -
wControl -
Returns:
Controller able to launch resourceable.

getEditorController

Controller getEditorController(OLATResourceable res,
                               UserRequest ureq,
                               WindowControl wControl)
Called if a user wants to edit a Resourceable that this handler can provide an editor for. (it is given here that this method can only be called when the current user is either olat admin or in the owning group of this resource

Parameters:
res -
ureq -
wControl -
Returns:
Controler able to edit resourceable.

getCloseResourceController

WizardCloseResourceController getCloseResourceController(UserRequest ureq,
                                                         WindowControl wControl,
                                                         RepositoryEntry repositoryEntry)
Parameters:
ureq -
wControl -
repositoryEntry -
Returns:

getAsMediaResource

MediaResource getAsMediaResource(OLATResourceable res)
Called if a user downloads a Resourceable that this handler can handle.

Parameters:
res -
Returns:
MediaResource delivering resourceable.

cleanupOnDelete

boolean cleanupOnDelete(OLATResourceable res,
                        UserRequest ureq,
                        WindowControl wControl)
Called if the repository entry referencing the given Resourceable will be deleted from the repository. Do any necessary cleanup work specific to this handler's type. The handler is responsible for deleting the resourceable aswell.

Parameters:
res -
ureq -
wControl -
Returns:
true if delete successfull, false if not.

readyToDelete

boolean readyToDelete(OLATResourceable res,
                      UserRequest ureq,
                      WindowControl wControl)
Called if the repository entry referencing the given Resourceable will be deleted from the repository. Return status wether to proceed with the delete action. If this method returns false, the entry will not be deleted.

Parameters:
res -
ureq -
wControl -
Returns:
true if ressource is ready to delete, false if not.

createCopy

OLATResourceable createCopy(OLATResourceable res,
                            UserRequest ureq)
Create a copy of the given resourceable.

Parameters:
res -
ureq -
Returns:
Copy of given resourceable.

getAddController

IAddController getAddController(RepositoryAddCallback callback,
                                java.lang.Object userObject,
                                UserRequest ureq,
                                WindowControl wControl)
Called the repository wants to add a new resourceable of this handler's type. Do any task necessary, set all fields of the provided RepositoryAddCallback and call callback.finished() upon success, or callback.canceled() / callback.failed(). The latter two will not create any repository entries. If you cancel or fail, do any cleanup work yourself. RepositoryHandler.delete() will not be called since (as outlined above) the repository does not create any entry at all. If callback.finished(), the user then enters repository details data. If the user finishes, AddController.finishTransaction() will be called. Do any final work now, since after this, the repository entry will be persisted. If the user aborts, AddController.abortTransaction() will be called. Do any cleanup work - no repository entry will be created in this state. The OLATResourceable set in the callback does not necessarily have to be persited.

Parameters:
callback -
userObject -
ureq -
wControl -
Returns:
Controller implementing Add workflow.

getDetailsComponent

Component getDetailsComponent(OLATResourceable res,
                              UserRequest ureq)
If a handler likes to provied any details on a resourceable in the repository's details view, he may do so by providing a component that renders the details.

Parameters:
res -
ureq -
Returns:
Controller displaying details or null, if no details are available.

archive

java.lang.String archive(Identity archiveOnBehalfOf,
                         java.lang.String archivFilePath,
                         RepositoryEntry repoEntry)

acquireLock

LockResult acquireLock(OLATResourceable ores,
                       Identity identity)
Acquires lock for the input ores and identity.

Parameters:
ores -
identity -
Returns:
the LockResult or null if no locking supported.

releaseLock

void releaseLock(LockResult lockResult)
Releases the lock.

Parameters:
lockResult - the LockResult received when locking

isLocked

boolean isLocked(OLATResourceable ores)
Parameters:
ores -
Returns: