Search in sources :

Example 1 with DeliveryOptionsConfigurationController

use of org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController in project openolat by klemens.

the class CPRuntimeController method doLayout.

private void doLayout(UserRequest ureq) {
    RepositoryEntry entry = getRepositoryEntry();
    final OLATResource resource = entry.getOlatResource();
    CPPackageConfig cpConfig = cpManager.getCPPackageConfig(resource);
    DeliveryOptions config = cpConfig == null ? null : cpConfig.getDeliveryOptions();
    WindowControl bwControl = getSubWindowControl("Layout");
    final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config, "Knowledge Transfer#_cp_layout");
    deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() {

        @Override
        public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
            if (source == deliveryOptionsCtrl && (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT)) {
                DeliveryOptions newConfig = deliveryOptionsCtrl.getDeliveryOptions();
                CPPackageConfig cConfig = cpManager.getCPPackageConfig(resource);
                if (cConfig == null) {
                    cConfig = new CPPackageConfig();
                }
                cConfig.setDeliveryOptions(newConfig);
                cpManager.setCPPackageConfig(resource, cConfig);
            }
        }
    });
    pushController(ureq, translate("tab.layout"), deliveryOptionsCtrl);
    setActiveTool(deliveryOptionsLink);
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) OLATResource(org.olat.resource.OLATResource) Event(org.olat.core.gui.control.Event) PopEvent(org.olat.core.gui.components.stack.PopEvent) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) Controller(org.olat.core.gui.control.Controller) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) UserRequest(org.olat.core.gui.UserRequest)

Example 2 with DeliveryOptionsConfigurationController

use of org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController in project openolat by klemens.

the class ScormRuntimeController method doLayout.

private void doLayout(UserRequest ureq) {
    RepositoryEntry entry = getRepositoryEntry();
    ScormPackageConfig scormConfig = ScormMainManager.getInstance().getScormPackageConfig(entry.getOlatResource());
    DeliveryOptions config = scormConfig == null ? null : scormConfig.getDeliveryOptions();
    final OLATResource resource = entry.getOlatResource();
    WindowControl bwControl = getSubWindowControl("Layout");
    final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config, "Knowledge Transfer#_scorm_layout");
    deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() {

        @Override
        public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
            if (source == deliveryOptionsCtrl && (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT)) {
                DeliveryOptions newConfig = deliveryOptionsCtrl.getDeliveryOptions();
                ScormPackageConfig sConfig = ScormMainManager.getInstance().getScormPackageConfig(resource);
                if (sConfig == null) {
                    sConfig = new ScormPackageConfig();
                }
                sConfig.setDeliveryOptions(newConfig);
                ScormMainManager.getInstance().setScormPackageConfig(resource, sConfig);
            }
        }
    });
    pushController(ureq, translate("tab.layout"), deliveryOptionsCtrl);
    setActiveTool(deliveryOptionsLink);
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) OLATResource(org.olat.resource.OLATResource) Event(org.olat.core.gui.control.Event) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) Controller(org.olat.core.gui.control.Controller) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) UserRequest(org.olat.core.gui.UserRequest)

Example 3 with DeliveryOptionsConfigurationController

use of org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController in project OpenOLAT by OpenOLAT.

the class ScormRuntimeController method doLayout.

private void doLayout(UserRequest ureq) {
    RepositoryEntry entry = getRepositoryEntry();
    ScormPackageConfig scormConfig = ScormMainManager.getInstance().getScormPackageConfig(entry.getOlatResource());
    DeliveryOptions config = scormConfig == null ? null : scormConfig.getDeliveryOptions();
    final OLATResource resource = entry.getOlatResource();
    WindowControl bwControl = getSubWindowControl("Layout");
    final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config, "Knowledge Transfer#_scorm_layout");
    deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() {

        @Override
        public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
            if (source == deliveryOptionsCtrl && (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT)) {
                DeliveryOptions newConfig = deliveryOptionsCtrl.getDeliveryOptions();
                ScormPackageConfig sConfig = ScormMainManager.getInstance().getScormPackageConfig(resource);
                if (sConfig == null) {
                    sConfig = new ScormPackageConfig();
                }
                sConfig.setDeliveryOptions(newConfig);
                ScormMainManager.getInstance().setScormPackageConfig(resource, sConfig);
            }
        }
    });
    pushController(ureq, translate("tab.layout"), deliveryOptionsCtrl);
    setActiveTool(deliveryOptionsLink);
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) OLATResource(org.olat.resource.OLATResource) Event(org.olat.core.gui.control.Event) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) Controller(org.olat.core.gui.control.Controller) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) UserRequest(org.olat.core.gui.UserRequest)

Example 4 with DeliveryOptionsConfigurationController

use of org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController in project OpenOLAT by OpenOLAT.

the class CPRuntimeController method doLayout.

private void doLayout(UserRequest ureq) {
    RepositoryEntry entry = getRepositoryEntry();
    final OLATResource resource = entry.getOlatResource();
    CPPackageConfig cpConfig = cpManager.getCPPackageConfig(resource);
    DeliveryOptions config = cpConfig == null ? null : cpConfig.getDeliveryOptions();
    WindowControl bwControl = getSubWindowControl("Layout");
    final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config, "Knowledge Transfer#_cp_layout");
    deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() {

        @Override
        public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
            if (source == deliveryOptionsCtrl && (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT)) {
                DeliveryOptions newConfig = deliveryOptionsCtrl.getDeliveryOptions();
                CPPackageConfig cConfig = cpManager.getCPPackageConfig(resource);
                if (cConfig == null) {
                    cConfig = new CPPackageConfig();
                }
                cConfig.setDeliveryOptions(newConfig);
                cpManager.setCPPackageConfig(resource, cConfig);
            }
        }
    });
    pushController(ureq, translate("tab.layout"), deliveryOptionsCtrl);
    setActiveTool(deliveryOptionsLink);
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) OLATResource(org.olat.resource.OLATResource) Event(org.olat.core.gui.control.Event) PopEvent(org.olat.core.gui.components.stack.PopEvent) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) Controller(org.olat.core.gui.control.Controller) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) UserRequest(org.olat.core.gui.UserRequest)

Aggregations

UserRequest (org.olat.core.gui.UserRequest)4 Controller (org.olat.core.gui.control.Controller)4 ControllerEventListener (org.olat.core.gui.control.ControllerEventListener)4 Event (org.olat.core.gui.control.Event)4 WindowControl (org.olat.core.gui.control.WindowControl)4 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)4 DeliveryOptionsConfigurationController (org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 RepositoryEntryRuntimeController (org.olat.repository.ui.RepositoryEntryRuntimeController)4 OLATResource (org.olat.resource.OLATResource)4 PopEvent (org.olat.core.gui.components.stack.PopEvent)2