Search in sources :

Example 6 with CertificateAndEfficiencyStatementController

use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.

the class EfficiencyStatementArtefactHandler method createDetailsController.

@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
    EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
    String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
    EfficiencyStatement statement = null;
    if (StringHelper.containsNonWhitespace(statementXml)) {
        try {
            statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
        } catch (Exception e) {
            log.error("Cannot load efficiency statement from artefact", e);
        }
    }
    CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
    return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager)

Example 7 with CertificateAndEfficiencyStatementController

use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.

the class EfficiencyStatementsPortletRunController method event.

/**
 * @see org.olat.core.gui.control.ControllerEventListener#dispatchEvent(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Controller source, Event event) {
    super.event(ureq, source, event);
    if (source == tableCtr) {
        if (event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) {
            TableEvent te = (TableEvent) event;
            String actionid = te.getActionId();
            if (actionid.equals(CMD_LAUNCH)) {
                int rowid = te.getRowId();
                final UserEfficiencyStatementLight statement = efficiencyStatementsListModel.getEfficiencyStatementAt(rowid);
                // will not be disposed on course run dispose, popus up as new browserwindow
                ControllerCreator ctrlCreator = new ControllerCreator() {

                    public Controller createController(UserRequest lureq, WindowControl lwControl) {
                        CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(lwControl, lureq, statement.getArchivedResourceKey());
                        return new LayoutMain3ColsController(lureq, getWindowControl(), efficiencyCtrl);
                    }
                };
                // wrap the content controller into a full header layout
                ControllerCreator layoutCtrlr = BaseFullWebappPopupLayoutFactory.createAuthMinimalPopupLayout(ureq, ctrlCreator);
                // open in new browser window
                PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
                pbw.open(ureq);
            // 
            }
        }
    }
}
Also used : TableEvent(org.olat.core.gui.components.table.TableEvent) PopupBrowserWindow(org.olat.core.gui.control.generic.popup.PopupBrowserWindow) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) UserEfficiencyStatementLight(org.olat.course.assessment.model.UserEfficiencyStatementLight) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) WindowControl(org.olat.core.gui.control.WindowControl) ControllerCreator(org.olat.core.gui.control.creator.ControllerCreator) UserRequest(org.olat.core.gui.UserRequest)

Example 8 with CertificateAndEfficiencyStatementController

use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project OpenOLAT by OpenOLAT.

the class UserDetailsController method doOpenEfficiencyStatementController.

private CertificateAndEfficiencyStatementController doOpenEfficiencyStatementController(UserRequest ureq) {
    if (statementCtrl == null || hasChanged) {
        removeAsListenerAndDispose(statementCtrl);
        RepositoryEntry entry = statementEntry.getCourse();
        UserEfficiencyStatement statement = statementEntry.getUserEfficencyStatement();
        EfficiencyStatement efficiencyStatement = null;
        if (statement != null) {
            RepositoryEntry re = statementEntry.getCourse();
            efficiencyStatement = efficiencyStatementManager.getUserEfficiencyStatementByCourseRepositoryEntry(re, assessedIdentity);
        }
        statementCtrl = new CertificateAndEfficiencyStatementController(getWindowControl(), ureq, assessedIdentity, null, entry.getOlatResource().getKey(), entry, efficiencyStatement, true);
        listenTo(statementCtrl);
        hasChanged = false;
    }
    mainVC.put("segmentCmp", statementCtrl.getInitialComponent());
    segmentView.select(efficiencyStatementLink);
    return statementCtrl;
}
Also used : UserEfficiencyStatement(org.olat.course.assessment.UserEfficiencyStatement) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) UserEfficiencyStatement(org.olat.course.assessment.UserEfficiencyStatement)

Example 9 with CertificateAndEfficiencyStatementController

use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project openolat by klemens.

the class EfficiencyStatementArtefactHandler method createDetailsController.

@Override
public Controller createDetailsController(UserRequest ureq, WindowControl wControl, AbstractArtefact artefact, boolean readOnlyMode) {
    EPFrontendManager ePFMgr = CoreSpringFactory.getImpl(EPFrontendManager.class);
    String statementXml = ePFMgr.getArtefactFullTextContent(artefact);
    EfficiencyStatement statement = null;
    if (StringHelper.containsNonWhitespace(statementXml)) {
        try {
            statement = (EfficiencyStatement) myXStream.fromXML(statementXml);
        } catch (Exception e) {
            log.error("Cannot load efficiency statement from artefact", e);
        }
    }
    CertificateAndEfficiencyStatementController efficiencyCtrl = new CertificateAndEfficiencyStatementController(wControl, ureq, statement);
    return new LayoutMain3ColsController(ureq, wControl, efficiencyCtrl);
}
Also used : LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) EPFrontendManager(org.olat.portfolio.manager.EPFrontendManager)

Example 10 with CertificateAndEfficiencyStatementController

use of org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController in project openolat by klemens.

the class UserDetailsController method doOpenEfficiencyStatementController.

private CertificateAndEfficiencyStatementController doOpenEfficiencyStatementController(UserRequest ureq) {
    if (statementCtrl == null || hasChanged) {
        removeAsListenerAndDispose(statementCtrl);
        RepositoryEntry entry = statementEntry.getCourse();
        UserEfficiencyStatement statement = statementEntry.getUserEfficencyStatement();
        EfficiencyStatement efficiencyStatement = null;
        if (statement != null) {
            RepositoryEntry re = statementEntry.getCourse();
            efficiencyStatement = efficiencyStatementManager.getUserEfficiencyStatementByCourseRepositoryEntry(re, assessedIdentity);
        }
        statementCtrl = new CertificateAndEfficiencyStatementController(getWindowControl(), ureq, assessedIdentity, null, entry.getOlatResource().getKey(), entry, efficiencyStatement, true);
        listenTo(statementCtrl);
        hasChanged = false;
    }
    mainVC.put("segmentCmp", statementCtrl.getInitialComponent());
    segmentView.select(efficiencyStatementLink);
    return statementCtrl;
}
Also used : UserEfficiencyStatement(org.olat.course.assessment.UserEfficiencyStatement) CertificateAndEfficiencyStatementController(org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController) RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatement(org.olat.course.assessment.EfficiencyStatement) UserEfficiencyStatement(org.olat.course.assessment.UserEfficiencyStatement)

Aggregations

CertificateAndEfficiencyStatementController (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementController)10 EfficiencyStatement (org.olat.course.assessment.EfficiencyStatement)6 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 WindowControl (org.olat.core.gui.control.WindowControl)4 UserRequest (org.olat.core.gui.UserRequest)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)2 UserEfficiencyStatement (org.olat.course.assessment.UserEfficiencyStatement)2 UserEfficiencyStatementLight (org.olat.course.assessment.model.UserEfficiencyStatementLight)2 EPFrontendManager (org.olat.portfolio.manager.EPFrontendManager)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2