Search in sources :

Example 16 with TooledStackedPanel

use of org.olat.core.gui.components.stack.TooledStackedPanel in project OpenOLAT by OpenOLAT.

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;
        }
    });
}
Also used : TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessmentMode(org.olat.course.assessment.AssessmentMode) MainLayout3ColumnsController(org.olat.core.gui.control.generic.layout.MainLayout3ColumnsController) CPDisplayController(org.olat.modules.cp.CPDisplayController) OLATResource(org.olat.resource.OLATResource) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) MainLayout3ColumnsController(org.olat.core.gui.control.generic.layout.MainLayout3ColumnsController) CPContentController(org.olat.ims.cp.ui.CPContentController) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CPDisplayController(org.olat.modules.cp.CPDisplayController) StepsMainRunController(org.olat.core.gui.control.generic.wizard.StepsMainRunController) MainLayoutController(org.olat.core.gui.control.generic.layout.MainLayoutController) CPRuntimeController(org.olat.ims.cp.ui.CPRuntimeController) CPEditMainController(org.olat.ims.cp.ui.CPEditMainController) Controller(org.olat.core.gui.control.Controller) LocalFolderImpl(org.olat.core.util.vfs.LocalFolderImpl) RuntimeControllerCreator(org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator) CPRuntimeController(org.olat.ims.cp.ui.CPRuntimeController) RepositoryEntrySecurity(org.olat.repository.model.RepositoryEntrySecurity) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CPPackageConfig(org.olat.ims.cp.ui.CPPackageConfig) File(java.io.File) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) UserRequest(org.olat.core.gui.UserRequest)

Example 17 with TooledStackedPanel

use of org.olat.core.gui.components.stack.TooledStackedPanel in project openolat by klemens.

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;
}
Also used : QTI21AssessmentDetailsController(org.olat.ims.qti21.ui.QTI21AssessmentDetailsController) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Translator(org.olat.core.gui.translator.Translator) IQEditController(org.olat.course.nodes.iq.IQEditController) QTI12ResultDetailsController(org.olat.ims.qti.QTI12ResultDetailsController) OLATResource(org.olat.resource.OLATResource) RepositoryEntry(org.olat.repository.RepositoryEntry) QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) IQIdentityListCourseNodeController(org.olat.course.nodes.iq.IQIdentityListCourseNodeController) IQRunController(org.olat.course.nodes.iq.IQRunController) QTI21AssessmentDetailsController(org.olat.ims.qti21.ui.QTI21AssessmentDetailsController) IQPreviewController(org.olat.course.nodes.iq.IQPreviewController) IQEditController(org.olat.course.nodes.iq.IQEditController) NodeEditController(org.olat.course.editor.NodeEditController) QTI12ResultDetailsController(org.olat.ims.qti.QTI12ResultDetailsController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) AssessmentCourseNodeController(org.olat.course.assessment.ui.tool.AssessmentCourseNodeController) Controller(org.olat.core.gui.control.Controller) Identity(org.olat.core.id.Identity)

Example 18 with TooledStackedPanel

use of org.olat.core.gui.components.stack.TooledStackedPanel in project openolat by klemens.

the class QTIEditorMainController method init.

private void init(UserRequest ureq) {
    main = createVelocityContainer("index");
    JSAndCSSComponent jsAndCss;
    // Add html header js
    jsAndCss = new JSAndCSSComponent("qitjsandcss", new String[] { "js/openolat/qti.js" }, null);
    main.put("qitjsandcss", jsAndCss);
    mainPanel = new Panel("p_qti_editor");
    mainPanel.setContent(main);
    if (notEditable) {
        // test not editable
        VelocityContainer notEditableVc = createVelocityContainer("notEditable");
        notEditableButton = LinkFactory.createButton("ok", notEditableVc, this);
        Panel panel = new Panel("notEditable");
        panel.setContent(notEditableVc);
        columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), null, panel, null);
        putInitialPanel(columnLayoutCtr.getInitialComponent());
        return;
    }
    stackedPanel = new TooledStackedPanel("qtiEditorStackedPanel", getTranslator(), this);
    stackedPanel.setCssClass("o_edit_mode");
    // initialize the history
    if (qtiPackage.isResumed() && qtiPackage.hasSerializedChangelog()) {
        // there were already changes made -> reload!
        history = qtiPackage.loadChangelog();
    } else {
        // start with a fresh history. Editor is resumed but no changes were made
        // so far.
        history = new HashMap<String, Memento>();
    }
    // The menu tree model represents the structure of the qti document.
    // All insert/move operations on the model are propagated to the structure
    // by the node
    menuTreeModel = new QTIEditorTreeModel(qtiPackage);
    menuTree = new MenuTree("QTIDocumentTree");
    menuTree.setTreeModel(menuTreeModel);
    menuTree.setSelectedNodeId(menuTree.getTreeModel().getRootNode().getIdent());
    // listen to the tree
    menuTree.addListener(this);
    // remember the qtidoc title when we started this editor, to correctly name
    // the history report
    startedWithTitle = menuTree.getSelectedNode().getAltText();
    // 
    main.put("tabbedPane", menuTreeModel.getQtiRootNode().createEditTabbedPane(ureq, getWindowControl(), getTranslator(), this));
    main.contextPut("qtititle", menuTreeModel.getQtiRootNode().getAltText());
    main.contextPut("isRestrictedEdit", restrictedEdit ? Boolean.TRUE : Boolean.FALSE);
    // 
    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), menuTree, mainPanel, "qtieditor" + qtiPackage.getRepresentingResourceable());
    listenTo(columnLayoutCtr);
    stackedPanel.pushController("Editor", columnLayoutCtr);
    // qtiPackage must be loaded previousely
    populateToolC();
    // Add css background
    if (restrictedEdit) {
        addSectionLink.setEnabled(false);
        addSCLink.setEnabled(false);
        addMCLink.setEnabled(false);
        addPoolLink.setEnabled(false);
        addFIBLink.setEnabled(false);
        if (!qtiPackage.getQTIDocument().isSurvey()) {
            addKPrimLink.setEnabled(false);
        }
        addEssayLink.setEnabled(false);
        columnLayoutCtr.addCssClassToMain("o_editor_qti_correct");
    } else {
        columnLayoutCtr.addCssClassToMain("o_editor_qti");
    }
    deleteLink.setEnabled(false);
    moveLink.setEnabled(false);
    copyLink.setEnabled(false);
    putInitialPanel(stackedPanel);
    if (restrictedEdit) {
        // we would like to us a modal dialog here, but this does not work! we
        // can't push to stack because the outher workflows pushes us after the
        // controller to the stack. Thus, if we used a modal dialog here the
        // dialog would never show up.
        columnLayoutCtr.setCol3(new Panel("empty"));
        columnLayoutCtr.hideCol1(true);
        columnLayoutCtr.hideCol2(true);
        String text = translate("qti.restricted.edit.warning") + "<br/><br/>" + createReferenceesMsg(ureq);
        proceedRestricedEditDialog = DialogBoxUIFactory.createYesNoDialog(ureq, getWindowControl(), null, text);
        listenTo(proceedRestricedEditDialog);
        proceedRestricedEditDialog.activate();
    }
}
Also used : QTIEditorTreeModel(org.olat.ims.qti.editor.tree.QTIEditorTreeModel) MenuTree(org.olat.core.gui.components.tree.MenuTree) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Panel(org.olat.core.gui.components.panel.Panel) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) Memento(org.olat.core.util.memento.Memento) JSAndCSSComponent(org.olat.core.gui.components.htmlheader.jscss.JSAndCSSComponent) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

TooledStackedPanel (org.olat.core.gui.components.stack.TooledStackedPanel)18 Controller (org.olat.core.gui.control.Controller)12 RepositoryEntry (org.olat.repository.RepositoryEntry)12 UserRequest (org.olat.core.gui.UserRequest)10 WindowControl (org.olat.core.gui.control.WindowControl)10 MainLayoutController (org.olat.core.gui.control.generic.layout.MainLayoutController)10 AssessmentMode (org.olat.course.assessment.AssessmentMode)10 RepositoryEntrySecurity (org.olat.repository.model.RepositoryEntrySecurity)10 RuntimeControllerCreator (org.olat.repository.ui.RepositoryEntryRuntimeController.RuntimeControllerCreator)10 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)8 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)6 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)6 OLATResource (org.olat.resource.OLATResource)6 BinderConfiguration (org.olat.modules.portfolio.BinderConfiguration)4 BinderSecurityCallback (org.olat.modules.portfolio.BinderSecurityCallback)4 BinderController (org.olat.modules.portfolio.ui.BinderController)4 FeedResourceSecurityCallback (org.olat.modules.webFeed.FeedResourceSecurityCallback)4 FeedSecurityCallback (org.olat.modules.webFeed.FeedSecurityCallback)4 FeedMainController (org.olat.modules.webFeed.ui.FeedMainController)4 FeedRuntimeController (org.olat.modules.webFeed.ui.FeedRuntimeController)4