use of org.olat.core.gui.components.stack.TooledStackedPanel in project OpenOLAT by OpenOLAT.
the class WikiHandler method createLaunchController.
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
// first handle special case: disabled wiki for security (XSS Attacks) reasons
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
if (!securityModule.isWikiEnabled()) {
return RepositoyUIFactory.createRepoEntryDisabledDueToSecurityMessageController(ureq, wControl);
}
// check role
boolean isOLatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
boolean isResourceOwner = false;
if (isOLatAdmin) {
isResourceOwner = true;
} else {
isResourceOwner = reSecurity.isOwner();
}
OLATResource res = re.getOlatResource();
BusinessControl bc = wControl.getBusinessControl();
final ContextEntry ce = bc.popLauncherContextEntry();
SubscriptionContext subsContext = new SubscriptionContext(res, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
final WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOLatAdmin, isGuestOnly, false, isResourceOwner, subsContext);
RepositoryEntryRuntimeController runtime = new RepositoryEntryRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {
@Override
public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
Controller controller;
if (ce != null) {
// jump to a certain context
OLATResourceable ores = ce.getOLATResourceable();
String typeName = ores.getResourceableTypeName();
String page = typeName.substring("page=".length());
controller = new WikiMainController(uureq, wwControl, entry.getOlatResource(), callback, page);
} else {
controller = new WikiMainController(uureq, wwControl, entry.getOlatResource(), callback, null);
}
return new OLATResourceableListeningWrapperController(uureq, wwControl, entry.getOlatResource(), controller, null, uureq.getIdentity());
}
});
return runtime;
}
use of org.olat.core.gui.components.stack.TooledStackedPanel in project OpenOLAT by OpenOLAT.
the class PodcastHandler method createLaunchController.
@Override
public MainLayoutController createLaunchController(RepositoryEntry re, RepositoryEntrySecurity reSecurity, UserRequest ureq, WindowControl wControl) {
boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
boolean isOwner = reSecurity.isOwner();
final FeedSecurityCallback callback = new FeedResourceSecurityCallback(isAdmin, isOwner);
SubscriptionContext subsContext = new SubscriptionContext(re.getOlatResource(), re.getSoftkey());
callback.setSubscriptionContext(subsContext);
return new FeedRuntimeController(ureq, wControl, re, reSecurity, new RuntimeControllerCreator() {
@Override
public Controller create(UserRequest uureq, WindowControl wwControl, TooledStackedPanel toolbarPanel, RepositoryEntry entry, RepositoryEntrySecurity security, AssessmentMode assessmentMode) {
CoreSpringFactory.getImpl(UserCourseInformationsManager.class).updateUserCourseInformations(entry.getOlatResource(), uureq.getIdentity());
return new FeedMainController(entry.getOlatResource(), uureq, wwControl, null, null, PodcastUIFactory.getInstance(uureq.getLocale()), callback, null);
}
});
}
use of org.olat.core.gui.components.stack.TooledStackedPanel in project OpenOLAT by OpenOLAT.
the class IQTESTCourseNode method getDetailsEditController.
/**
* @see org.olat.course.nodes.AssessableCourseNode#getDetailsEditController(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.WindowControl,
* org.olat.course.run.userview.UserCourseEnvironment)
*/
@Override
public Controller getDetailsEditController(UserRequest ureq, WindowControl wControl, BreadcrumbPanel stackPanel, UserCourseEnvironment coachCourseEnv, UserCourseEnvironment assessedUserCourseEnv) {
Controller detailsCtrl = null;
RepositoryEntry ref = getReferencedRepositoryEntry();
if (ref != null) {
OLATResource resource = ref.getOlatResource();
Long courseResourceableId = assessedUserCourseEnv.getCourseEnvironment().getCourseResourceableId();
Identity assessedIdentity = assessedUserCourseEnv.getIdentityEnvironment().getIdentity();
if (ImsQTI21Resource.TYPE_NAME.equals(resource.getResourceableTypeName())) {
RepositoryEntry courseEntry = assessedUserCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
detailsCtrl = new QTI21AssessmentDetailsController(ureq, wControl, (TooledStackedPanel) stackPanel, courseEntry, this, coachCourseEnv, assessedUserCourseEnv);
} else if (OnyxModule.isOnyxTest(ref.getOlatResource())) {
Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
detailsCtrl = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
} else {
detailsCtrl = new QTI12ResultDetailsController(ureq, wControl, courseResourceableId, getIdent(), coachCourseEnv, assessedIdentity, ref, AssessmentInstance.QMD_ENTRY_TYPE_ASSESS);
}
}
return detailsCtrl;
}
use of org.olat.core.gui.components.stack.TooledStackedPanel in project openolat by klemens.
the class PortfolioConfigForm method doPreview.
private void doPreview(UserRequest ureq) {
removeAsListenerAndDispose(previewCtr);
removeAsListenerAndDispose(columnLayoutCtr);
if (map != null) {
EPSecurityCallback secCallback = new EPSecurityCallbackImpl(false, true);
previewCtr = EPUIFactory.createPortfolioStructureMapPreviewController(ureq, getWindowControl(), map, secCallback);
} else if (binder != null && stackPanel instanceof TooledStackedPanel) {
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getReadOnlyCallback();
BinderConfiguration bConfig = BinderConfiguration.createTemplateConfig(false);
previewCtr = new BinderController(ureq, getWindowControl(), (TooledStackedPanel) stackPanel, secCallback, binder, bConfig);
} else {
return;
}
listenTo(previewCtr);
columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), previewCtr);
stackPanel.pushController(translate("preview.map"), columnLayoutCtr);
listenTo(columnLayoutCtr);
}
use of org.olat.core.gui.components.stack.TooledStackedPanel in project openolat by klemens.
the class PortfolioResultDetailsController method doOpenMap.
private void doOpenMap(UserRequest ureq, Binder binder) {
if (stackPanel instanceof TooledStackedPanel) {
binder = portfolioService.getBinderByKey(binder.getKey());
portfolioService.updateBinderUserInformations(binder, getIdentity());
List<AccessRights> rights = portfolioService.getAccessRights(binder, getIdentity());
BinderSecurityCallback secCallback = BinderSecurityCallbackFactory.getCallbackForCourseCoach(binder, rights);
BinderConfiguration config = BinderConfiguration.createConfig(binder);
BinderController binderCtrl = new BinderController(ureq, getWindowControl(), (TooledStackedPanel) stackPanel, secCallback, binder, config);
String displayName = StringHelper.escapeHtml(binder.getTitle());
stackPanel.pushController(displayName, binderCtrl);
binderCtrl.activate(ureq, null, null);
}
}
Aggregations