org.olat.commons.file.filechooser
Class FileChooseCreateEditController

java.lang.Object
  extended by org.olat.core.gui.control.DefaultController
      extended by org.olat.core.gui.control.controller.BasicController
          extended by org.olat.commons.file.filechooser.FileChooseCreateEditController
All Implemented Interfaces:
Controller, ControllerEventListener, Disposable
Direct Known Subclasses:
LinkChooseCreateEditController

public class FileChooseCreateEditController
extends BasicController

Description:
Use the setIframeEnabled for configuration of preview behaviour

Author:
alex, BPS (BPS Bildungsportal Sachsen GmbH)

Field Summary
static Event ALLOW_RELATIVE_LINKS_CHANGED_EVENT
          Event fired when configuration option to allow relative links has been changed
static Event FILE_CHANGED_EVENT
          Event fired when another file has been choosen (filename has changed)
static Event FILE_CONTENT_CHANGED_EVENT
          Event fired when the content of the file has been changed with the editor
static java.lang.String[] INITIAL_ALLOWED_FILE_SUFFIXES
           
 
Constructor Summary
FileChooseCreateEditController(UserRequest ureq, WindowControl wControl, java.lang.String chosenFile, java.lang.Boolean allowRelativeLinks, VFSContainer rootContainer)
           
FileChooseCreateEditController(UserRequest ureq, WindowControl wControl, java.lang.String chosenFile, java.lang.Boolean allowRelativeLinks, VFSContainer rootContainer, java.lang.String target, java.lang.String fieldSetLegend)
           
 
Method Summary
 void event(UserRequest ureq, Component source, Event event)
          abstract event method for subclasses.
 void event(UserRequest ureq, Controller source, Event event)
          the only method of the interface controllereventlistener.
 java.lang.Boolean getAllowRelativeLinks()
           
 java.lang.String getChosenFile()
           
 void setAllFileSuffixesAllowed(boolean allowed)
          All types of files are allowed.
 void setAllowedFileSuffixes(java.lang.String[] allowedFileSuffixes)
          Setting supported file-suffix
 void setIframeEnabled(boolean iframeEnabled)
          Settings for preview mode of selected file.
 void setShowHomeLink(boolean showHomeLink)
          Setting for preview mode of selected file.
 
Methods inherited from class org.olat.core.gui.control.DefaultController
addControllerListener, addLoggingResourceable, dispatchEvent, dispatchEvent, dispose, getControllerCount, getInitialComponent, getUserActivityLogger, getWindowControlForDebug, isDisposed, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_CHANGED_EVENT

public static final Event FILE_CHANGED_EVENT
Event fired when another file has been choosen (filename has changed)


FILE_CONTENT_CHANGED_EVENT

public static final Event FILE_CONTENT_CHANGED_EVENT
Event fired when the content of the file has been changed with the editor


ALLOW_RELATIVE_LINKS_CHANGED_EVENT

public static final Event ALLOW_RELATIVE_LINKS_CHANGED_EVENT
Event fired when configuration option to allow relative links has been changed


INITIAL_ALLOWED_FILE_SUFFIXES

public static java.lang.String[] INITIAL_ALLOWED_FILE_SUFFIXES
Constructor Detail

FileChooseCreateEditController

public FileChooseCreateEditController(UserRequest ureq,
                                      WindowControl wControl,
                                      java.lang.String chosenFile,
                                      java.lang.Boolean allowRelativeLinks,
                                      VFSContainer rootContainer,
                                      java.lang.String target,
                                      java.lang.String fieldSetLegend)
Parameters:
ureq -
wControl -
chosenFile -
allowRelativeLinks -
rootContainer -
target -
fieldSetLegend -

FileChooseCreateEditController

public FileChooseCreateEditController(UserRequest ureq,
                                      WindowControl wControl,
                                      java.lang.String chosenFile,
                                      java.lang.Boolean allowRelativeLinks,
                                      VFSContainer rootContainer)
Parameters:
ureq -
wControl -
chosenFile -
allowRelativeLinks -
rootContainer -
Method Detail

event

public void event(UserRequest ureq,
                  Controller source,
                  Event event)
Description copied from class: DefaultController
the only method of the interface controllereventlistener. always gets called when a controller we 'subscribed' to fires an event. we provide a default implementation here since there are many controllers which are standalone and need no subcontrollers


event

public void event(UserRequest ureq,
                  Component source,
                  Event event)
Description copied from class: DefaultController
abstract event method for subclasses. the event received from the component we are listening to are always rerouted to this method here, except when the component has been disposed, in which case the events are simply ignored.

See Also:
DefaultController.event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)

getChosenFile

public java.lang.String getChosenFile()
Returns:
The choosen file name

getAllowRelativeLinks

public java.lang.Boolean getAllowRelativeLinks()
Returns:
The configuration for the allow relative links flag

setIframeEnabled

public void setIframeEnabled(boolean iframeEnabled)
Settings for preview mode of selected file. Default is set to false

Parameters:
iframeEnabled - true: show content in iframe, false: show content embedded.

setShowHomeLink

public void setShowHomeLink(boolean showHomeLink)
Setting for preview mode of selected file. Default is set to true

Parameters:
showHomeLink - true enables the home link icon and link

setAllFileSuffixesAllowed

public void setAllFileSuffixesAllowed(boolean allowed)
All types of files are allowed.

Parameters:
allowed -

setAllowedFileSuffixes

public void setAllowedFileSuffixes(java.lang.String[] allowedFileSuffixes)
Setting supported file-suffix

Parameters:
allowedFileSuffixes - New list of allowed file-suffix e.g. html, htm