use of org.olat.core.gui.control.generic.iframe.DeliveryOptions in project openolat by klemens.
the class SPEditController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source instanceof NodeEditController) {
if (combiLinkCtr != null && combiLinkCtr.isDoProposal()) {
combiLinkCtr.setRelFilePath(CourseEditorHelper.createUniqueRelFilePathFromShortTitle(courseNode, courseFolderBaseContainer));
}
} else if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == deliveryOptionsCtrl) {
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
DeliveryOptions config = deliveryOptionsCtrl.getDeliveryOptions();
if (config != null) {
moduleConfiguration.set(CONFIG_KEY_DELIVERYOPTIONS, config);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
} else if (source == combiLinkCtr) {
if (event == Event.DONE_EVENT) {
String relPath = VFSManager.getRelativeItemPath(combiLinkCtr.getFile(), courseFolderBaseContainer, null);
combiLinkCtr.setEditable(hasEditRights(relPath));
moduleConfiguration.set(CONFIG_KEY_FILE, relPath);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
if (!myTabbedPane.containsTab(deliveryOptionsCtrl.getInitialComponent())) {
myTabbedPane.addTab(translate(PANE_TAB_DELIVERYOPTIONS), deliveryOptionsCtrl.getInitialComponent());
}
myContent.contextPut("editorEnabled", combiLinkCtr.isEditorEnabled());
}
} else if (source == securitySettingForm) {
if (event == Event.DONE_EVENT) {
boolean allowRelativeLinks = securitySettingForm.getAllowRelativeLinksConfig();
moduleConfiguration.set(CONFIG_KEY_ALLOW_RELATIVE_LINKS, allowRelativeLinks);
moduleConfiguration.set(CONFIG_KEY_ALLOW_COACH_EDIT, securitySettingForm.getAllowCoachEditConfig());
combiLinkCtr.setAllowEditorRelativeLinks(allowRelativeLinks);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.core.gui.control.generic.iframe.DeliveryOptions in project openolat by klemens.
the class SPRunController method doInlineIntegration.
private void doInlineIntegration(UserRequest ureq, boolean hasEditRightsTo) {
boolean allowRelativeLinks = config.getBooleanSafe(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS);
// create the possibility to float
OLATResourceable ores = OresHelper.createOLATResourceableInstance(ICourse.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
DeliveryOptions deliveryOptions = (DeliveryOptions) config.get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS);
spCtr = new SinglePageController(ureq, getWindowControl(), courseFolderContainer, fileName, allowRelativeLinks, null, ores, deliveryOptions, userCourseEnv.getCourseEnvironment().isPreview());
spCtr.setAllowDownload(true);
// only for inline integration: register for controller event to forward a olatcmd to the course,
// and also to remember latest position in the script
listenTo(spCtr);
// enable edit mode if user has the according rights
if (hasEditRightsTo) {
spCtr.allowPageEditing();
// set the link tree model to internal for the HTML editor
if (linkTreeModel != null) {
spCtr.setInternalLinkTreeModel(linkTreeModel);
}
}
// create clone wrapper layout
CloneLayoutControllerCreatorCallback clccc = new CloneLayoutControllerCreatorCallback() {
public ControllerCreator createLayoutControllerCreator(UserRequest uureq, final ControllerCreator contentControllerCreator) {
return BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(uureq, new ControllerCreator() {
public Controller createController(UserRequest lureq, WindowControl lwControl) {
// Wrap in column layout, popup window needs a layout controller
Controller ctr = contentControllerCreator.createController(lureq, lwControl);
LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(lureq, lwControl, ctr);
layoutCtr.setCustomCSS(CourseFactory.getCustomCourseCss(lureq.getUserSession(), userCourseEnv.getCourseEnvironment()));
// Controller titledCtrl = TitledWrapperHelper.getWrapper(lureq, lwControl, ctr, courseNode, "o_sp_icon");
layoutCtr.addDisposableChildController(ctr);
return layoutCtr;
}
});
}
};
Controller ctrl = TitledWrapperHelper.getWrapper(ureq, getWindowControl(), spCtr, courseNode, "o_sp_icon");
if (ctrl instanceof CloneableController) {
cloneC = new CloneController(ureq, getWindowControl(), (CloneableController) ctrl, clccc);
listenTo(cloneC);
main.setContent(cloneC.getInitialComponent());
} else {
throw new AssertException("Controller must be cloneable");
}
}
use of org.olat.core.gui.control.generic.iframe.DeliveryOptions 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);
}
use of org.olat.core.gui.control.generic.iframe.DeliveryOptions in project openolat by klemens.
the class ImsCPHandler method createLaunchController.
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
OLATResource res = re.getOlatResource();
File cpRoot = FileResourceManager.getInstance().unzipFileResource(res);
final LocalFolderImpl vfsWrapper = new LocalFolderImpl(cpRoot);
CPPackageConfig packageConfig = CPManager.getInstance().getCPPackageConfig(res);
final DeliveryOptions deliveryOptions = (packageConfig == null ? null : packageConfig.getDeliveryOptions());
return new CPRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {
@Override
public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
boolean activateFirstPage = true;
String initialUri = null;
CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
CPDisplayController cpCtr = new CPDisplayController(uureq, wwControl, vfsWrapper, true, true, activateFirstPage, true, deliveryOptions, initialUri, entry.getOlatResource(), "", false);
MainLayout3ColumnsController ctr = new LayoutMain3ColsController(uureq, wwControl, cpCtr.getMenuComponent(), cpCtr.getInitialComponent(), vfsWrapper.getName());
ctr.addDisposableChildController(cpCtr);
return ctr;
}
});
}
use of org.olat.core.gui.control.generic.iframe.DeliveryOptions 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);
}
Aggregations