org.olat.repository.handlers
Class BlogHandler

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

public class BlogHandler
extends java.lang.Object
implements RepositoryHandler

Responsible class for handling any actions involving blog resources.

Initial Date: Feb 25, 2009

Author:
Gregor Wassmann

Field Summary
static java.lang.String PROCESS_CREATENEW
           
static java.lang.String PROCESS_UPLOAD
           
 
Constructor Summary
BlogHandler()
           
 
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 control)
          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 control, 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 control)
          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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCESS_CREATENEW

public static final java.lang.String PROCESS_CREATENEW
See Also:
Constant Field Values

PROCESS_UPLOAD

public static final java.lang.String PROCESS_UPLOAD
See Also:
Constant Field Values
Constructor Detail

BlogHandler

public BlogHandler()
Method Detail

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)

archive

public java.lang.String archive(Identity archiveOnBehalfOf,
                                java.lang.String archivFilePath,
                                RepositoryEntry repoEntry)
Specified by:
archive in interface RepositoryHandler
See Also:
org.olat.repository.handlers.RepositoryHandler#archive(java.lang.String, org.olat.repository.RepositoryEntry)

cleanupOnDelete

public boolean cleanupOnDelete(OLATResourceable res,
                               UserRequest ureq,
                               WindowControl control)
Description copied from interface: RepositoryHandler
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.

Specified by:
cleanupOnDelete in interface RepositoryHandler
Returns:
true if delete successfull, false if not.
See Also:
RepositoryHandler.cleanupOnDelete(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

createCopy

public OLATResourceable createCopy(OLATResourceable res,
                                   UserRequest ureq)
Description copied from interface: RepositoryHandler
Create a copy of the given resourceable.

Specified by:
createCopy in interface RepositoryHandler
Returns:
Copy of given resourceable.
See Also:
RepositoryHandler.createCopy(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest)

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

getAsMediaResource

public MediaResource getAsMediaResource(OLATResourceable res)
Description copied from interface: RepositoryHandler
Called if a user downloads a Resourceable that this handler can handle.

Specified by:
getAsMediaResource in interface RepositoryHandler
Returns:
MediaResource delivering resourceable.
See Also:
RepositoryHandler.getAsMediaResource(org.olat.core.id.OLATResourceable)

getDetailsComponent

public Component getDetailsComponent(OLATResourceable res,
                                     UserRequest ureq)
Description copied from interface: RepositoryHandler
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.

Specified by:
getDetailsComponent in interface RepositoryHandler
Returns:
Controller displaying details or null, if no details are available.
See Also:
RepositoryHandler.getDetailsComponent(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest)

getEditorController

public Controller getEditorController(OLATResourceable res,
                                      UserRequest ureq,
                                      WindowControl control)
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:
RepositoryHandler.getEditorController(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

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:
RepositoryHandler.getLaunchController(org.olat.core.id.OLATResourceable, java.lang.String, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

getSupportedTypes

public java.util.List<java.lang.String> 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()

readyToDelete

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

Specified by:
readyToDelete in interface RepositoryHandler
Returns:
true if ressource is ready to delete, false if not.
See Also:
RepositoryHandler.readyToDelete(org.olat.core.id.OLATResourceable, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)

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)

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()

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()

getCloseResourceController

public WizardCloseResourceController getCloseResourceController(UserRequest ureq,
                                                                WindowControl control,
                                                                RepositoryEntry repositoryEntry)
Specified by:
getCloseResourceController in interface RepositoryHandler
Returns:
See Also:
RepositoryHandler.getCloseResourceController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, org.olat.repository.RepositoryEntry)

isLocked

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