Search in sources :

Example 1 with PageRunControllerElement

use of org.olat.modules.portfolio.ui.editor.PageRunControllerElement in project OpenOLAT by OpenOLAT.

the class FileUploadHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    if (element instanceof FileUpload) {
        FileUpload fileUpload = (FileUpload) element;
        Controller ctrl = new FileUploadController(ureq, wControl, fileUpload);
        return new PageRunControllerElement(ctrl);
    }
    return null;
}
Also used : PageRunControllerElement(org.olat.modules.portfolio.ui.editor.PageRunControllerElement) FileUploadController(org.olat.modules.forms.ui.FileUploadController) FileUploadEditorController(org.olat.modules.forms.ui.FileUploadEditorController) Controller(org.olat.core.gui.control.Controller) PageElementEditorController(org.olat.modules.portfolio.ui.editor.PageElementEditorController) FileUpload(org.olat.modules.forms.model.xml.FileUpload) FileUploadController(org.olat.modules.forms.ui.FileUploadController)

Example 2 with PageRunControllerElement

use of org.olat.modules.portfolio.ui.editor.PageRunControllerElement in project OpenOLAT by OpenOLAT.

the class EvaluationFormHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    Controller ctrl = null;
    if (element instanceof EvaluationFormPart) {
        PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
        // find assignment
        EvaluationFormPart eva = (EvaluationFormPart) element;
        PageBody body = eva.getBody();
        Assignment assignment = portfolioService.getAssignment(body);
        if (assignment == null) {
            ctrl = getController(ureq, wControl, body, eva);
        } else {
            ctrl = getControllerForAssignment(ureq, wControl, body, assignment, hints.isOnePage());
        }
    }
    if (ctrl == null) {
        Translator translator = Util.createPackageTranslator(PortfolioHomeController.class, ureq.getLocale());
        String title = translator.translate("warning.evaluation.not.visible.title");
        String text = translator.translate("warning.evaluation.not.visible.text");
        ctrl = MessageUIFactory.createWarnMessage(ureq, wControl, title, text);
    }
    return new PageRunControllerElement(ctrl);
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) PageRunControllerElement(org.olat.modules.portfolio.ui.editor.PageRunControllerElement) EvaluationFormPart(org.olat.modules.portfolio.model.EvaluationFormPart) PortfolioService(org.olat.modules.portfolio.PortfolioService) Translator(org.olat.core.gui.translator.Translator) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioHomeController(org.olat.modules.portfolio.ui.PortfolioHomeController) PageBody(org.olat.modules.portfolio.PageBody)

Example 3 with PageRunControllerElement

use of org.olat.modules.portfolio.ui.editor.PageRunControllerElement in project openolat by klemens.

the class EvaluationFormHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    Controller ctrl = null;
    if (element instanceof EvaluationFormPart) {
        PortfolioService portfolioService = CoreSpringFactory.getImpl(PortfolioService.class);
        // find assignment
        EvaluationFormPart eva = (EvaluationFormPart) element;
        PageBody body = eva.getBody();
        Assignment assignment = portfolioService.getAssignment(body);
        if (assignment == null) {
            ctrl = getController(ureq, wControl, body, eva);
        } else {
            ctrl = getControllerForAssignment(ureq, wControl, body, assignment, hints.isOnePage());
        }
    }
    if (ctrl == null) {
        Translator translator = Util.createPackageTranslator(PortfolioHomeController.class, ureq.getLocale());
        String title = translator.translate("warning.evaluation.not.visible.title");
        String text = translator.translate("warning.evaluation.not.visible.text");
        ctrl = MessageUIFactory.createWarnMessage(ureq, wControl, title, text);
    }
    return new PageRunControllerElement(ctrl);
}
Also used : Assignment(org.olat.modules.portfolio.Assignment) PageRunControllerElement(org.olat.modules.portfolio.ui.editor.PageRunControllerElement) EvaluationFormPart(org.olat.modules.portfolio.model.EvaluationFormPart) PortfolioService(org.olat.modules.portfolio.PortfolioService) Translator(org.olat.core.gui.translator.Translator) MultiEvaluationFormController(org.olat.modules.portfolio.ui.MultiEvaluationFormController) Controller(org.olat.core.gui.control.Controller) EvaluationFormController(org.olat.modules.forms.ui.EvaluationFormController) PortfolioHomeController(org.olat.modules.portfolio.ui.PortfolioHomeController) PageBody(org.olat.modules.portfolio.PageBody)

Example 4 with PageRunControllerElement

use of org.olat.modules.portfolio.ui.editor.PageRunControllerElement in project openolat by klemens.

the class FileUploadHandler method getContent.

@Override
public PageRunElement getContent(UserRequest ureq, WindowControl wControl, PageElement element, PageElementRenderingHints hints) {
    if (element instanceof FileUpload) {
        FileUpload fileUpload = (FileUpload) element;
        Controller ctrl = new FileUploadController(ureq, wControl, fileUpload);
        return new PageRunControllerElement(ctrl);
    }
    return null;
}
Also used : PageRunControllerElement(org.olat.modules.portfolio.ui.editor.PageRunControllerElement) FileUploadController(org.olat.modules.forms.ui.FileUploadController) FileUploadEditorController(org.olat.modules.forms.ui.FileUploadEditorController) Controller(org.olat.core.gui.control.Controller) PageElementEditorController(org.olat.modules.portfolio.ui.editor.PageElementEditorController) FileUpload(org.olat.modules.forms.model.xml.FileUpload) FileUploadController(org.olat.modules.forms.ui.FileUploadController)

Aggregations

Controller (org.olat.core.gui.control.Controller)4 PageRunControllerElement (org.olat.modules.portfolio.ui.editor.PageRunControllerElement)4 Translator (org.olat.core.gui.translator.Translator)2 FileUpload (org.olat.modules.forms.model.xml.FileUpload)2 EvaluationFormController (org.olat.modules.forms.ui.EvaluationFormController)2 FileUploadController (org.olat.modules.forms.ui.FileUploadController)2 FileUploadEditorController (org.olat.modules.forms.ui.FileUploadEditorController)2 Assignment (org.olat.modules.portfolio.Assignment)2 PageBody (org.olat.modules.portfolio.PageBody)2 PortfolioService (org.olat.modules.portfolio.PortfolioService)2 EvaluationFormPart (org.olat.modules.portfolio.model.EvaluationFormPart)2 MultiEvaluationFormController (org.olat.modules.portfolio.ui.MultiEvaluationFormController)2 PortfolioHomeController (org.olat.modules.portfolio.ui.PortfolioHomeController)2 PageElementEditorController (org.olat.modules.portfolio.ui.editor.PageElementEditorController)2