org.olat.repository.handlers
Class WebDocumentHandler

java.lang.Object
  extended by org.olat.repository.handlers.FileHandler
      extended by org.olat.repository.handlers.WebDocumentHandler
All Implemented Interfaces:
RepositoryHandler

public class WebDocumentHandler
extends FileHandler
implements RepositoryHandler

Initial Date: Apr 6, 2004

Author:
Mike Stock Comment:

Constructor Summary
WebDocumentHandler()
          Default constructor.
 
Method Summary
 LockResult acquireLock(OLATResourceable ores, Identity identity)
          Acquires lock for the input ores and identity.
 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.
 WizardCloseResourceController getCloseResourceController(UserRequest ureq, WindowControl wControl, RepositoryEntry repositoryEntry)
           
 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 getSupportedTypes()
          Return the typeNames of OLATResourceable this Handler can handle.
 boolean isLocked(OLATResourceable ores)
           
 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.
 
Methods inherited from class org.olat.repository.handlers.FileHandler
archive, cleanupOnDelete, createCopy, getAsMediaResource, getDetailsComponent, readyToDelete
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.olat.repository.handlers.RepositoryHandler
archive, cleanupOnDelete, createCopy, getAsMediaResource, getDetailsComponent, readyToDelete
 

Constructor Detail

WebDocumentHandler

public WebDocumentHandler()
Default constructor.

Method Detail

getSupportedTypes

public java.util.List getSupportedTypes()
Description copied from interface: RepositoryHandler
Return the typeNames of OLATResourceable this Handler can handle.

Specified by:
getSupportedTypes in interface RepositoryHandler
Returns:
List of supported types.
See Also:
RepositoryHandler.getSupportedTypes()

supportsLaunch

public boolean supportsLaunch()
Description copied from interface: RepositoryHandler
Return true if this handler supports launching Resourceables of its type.

Specified by:
supportsLaunch in interface RepositoryHandler
Returns:
true if this handler supports launching Resourceables of its type.
See Also:
RepositoryHandler.supportsLaunch()

supportsDownload

public boolean supportsDownload()
Description copied from interface: RepositoryHandler
Return true if this handler supports donwloading Resourceables of its type.

Specified by:
supportsDownload in interface RepositoryHandler
Returns:
true if this handler supports donwloading Resourceables of its type.
See Also:
RepositoryHandler.supportsDownload()

supportsEdit

public boolean supportsEdit()
Description copied from interface: RepositoryHandler
Return true if this handler supports an editor for Resourceables of its type.

Specified by:
supportsEdit in interface RepositoryHandler
Returns:
true if this handler supports an editor for Resourceables of its type.
See Also:
RepositoryHandler.supportsEdit()

getLaunchController

public MainLayoutController getLaunchController(OLATResourceable res,
                                                java.lang.String initialViewIdentifier,
                                                UserRequest ureq,
                                                WindowControl wControl)
Description copied from interface: RepositoryHandler
Called if a user launches a Resourceable that this handler can handle.

Specified by:
getLaunchController in interface RepositoryHandler
initialViewIdentifier - if null the default view will be started, otherwise a controllerfactory type dependant view will be activated (subscription subtype)
Returns:
Controller able to launch resourceable.
See Also:
org.olat.repository.handlers.RepositoryHandler#getLaunchController(org.olat.core.id.OLATResourceable java.lang.String, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

getEditorController

public Controller getEditorController(OLATResourceable res,
                                      UserRequest ureq,
                                      WindowControl wControl)
Description copied from interface: RepositoryHandler
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

Specified by:
getEditorController in interface RepositoryHandler
Returns:
Controler able to edit resourceable.
See Also:
org.olat.repository.handlers.RepositoryHandler#getEditorController(org.olat.core.id.OLATResourceable org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

getAddController

public IAddController getAddController(RepositoryAddCallback callback,
                                       java.lang.Object userObject,
                                       UserRequest ureq,
                                       WindowControl wControl)
Description copied from interface: RepositoryHandler
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.

Specified by:
getAddController in interface RepositoryHandler
Overrides:
getAddController in class FileHandler
Returns:
Controller implementing Add workflow.
See Also:
RepositoryHandler.getAddController(org.olat.repository.controllers.RepositoryAddCallback, java.lang.Object, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

acquireLock

public LockResult acquireLock(OLATResourceable ores,
                              Identity identity)
Description copied from interface: RepositoryHandler
Acquires lock for the input ores and identity.

Specified by:
acquireLock in interface RepositoryHandler
Returns:
the LockResult or null if no locking supported.
See Also:
RepositoryHandler.acquireLock(org.olat.core.id.OLATResourceable, org.olat.core.id.Identity)

releaseLock

public void releaseLock(LockResult lockResult)
Description copied from interface: RepositoryHandler
Releases the lock.

Specified by:
releaseLock in interface RepositoryHandler
Parameters:
lockResult - the LockResult received when locking
See Also:
RepositoryHandler.releaseLock(org.olat.core.util.coordinate.LockResult)

isLocked

public boolean isLocked(OLATResourceable ores)
Specified by:
isLocked in interface RepositoryHandler
Returns:
See Also:
RepositoryHandler.isLocked(org.olat.core.id.OLATResourceable)

getCloseResourceController

public WizardCloseResourceController getCloseResourceController(UserRequest ureq,
                                                                WindowControl wControl,
                                                                RepositoryEntry repositoryEntry)
Specified by:
getCloseResourceController in interface RepositoryHandler
Returns: