Search in sources :

Example 81 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class SharedFolderHandler method readyToDelete.

@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
    ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
    String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
    if (referencesSummary != null) {
        Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
        errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
        return false;
    }
    return true;
}
Also used : Translator(org.olat.core.gui.translator.Translator) ReferenceManager(org.olat.resource.references.ReferenceManager)

Example 82 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class GlossaryHandler method readyToDelete.

@Override
public boolean readyToDelete(RepositoryEntry entry, Identity identity, Roles roles, Locale locale, ErrorList errors) {
    ReferenceManager refM = CoreSpringFactory.getImpl(ReferenceManager.class);
    String referencesSummary = refM.getReferencesToSummary(entry.getOlatResource(), locale);
    if (referencesSummary != null) {
        Translator translator = Util.createPackageTranslator(RepositoryManager.class, locale);
        errors.setError(translator.translate("details.delete.error.references", new String[] { referencesSummary, entry.getDisplayname() }));
        return false;
    }
    return true;
}
Also used : Translator(org.olat.core.gui.translator.Translator) ReferenceManager(org.olat.resource.references.ReferenceManager)

Example 83 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class GenericCourseNode method createPreviewController.

/**
 * default implementation of the previewController
 *
 * @see org.olat.course.nodes.CourseNode#createPreviewController(org.olat.core.gui.UserRequest,
 * @see org.olat.core.gui.control.WindowControl,
 * @see org.olat.course.run.userview.UserCourseEnvironment,
 * @see org.olat.course.run.userview.NodeEvaluation)
 */
// no userCourseEnv or NodeEvaluation needed here
@Override
public Controller createPreviewController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    Translator translator = Util.createPackageTranslator(GenericCourseNode.class, ureq.getLocale());
    String text = translator.translate("preview.notavailable");
    return MessageUIFactory.createInfoMessage(ureq, wControl, null, text);
}
Also used : Translator(org.olat.core.gui.translator.Translator)

Example 84 with Translator

use of org.olat.core.gui.translator.Translator in project OpenOLAT by OpenOLAT.

the class IQSELFCourseNode method createNodeRunConstructionResult.

/**
 * @see org.olat.course.nodes.CourseNode#createNodeRunConstructionResult(org.olat.core.gui.UserRequest,
 *      org.olat.core.gui.control.WindowControl,
 *      org.olat.course.run.userview.UserCourseEnvironment,
 *      org.olat.course.run.userview.NodeEvaluation)
 */
@Override
public NodeRunConstructionResult createNodeRunConstructionResult(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) {
    Controller runController;
    ModuleConfiguration config = getModuleConfiguration();
    AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
    boolean onyx = IQEditController.CONFIG_VALUE_QTI2.equals(config.get(IQEditController.CONFIG_KEY_TYPE_QTI));
    if (onyx) {
        Translator trans = Util.createPackageTranslator(IQEditController.class, ureq.getLocale());
        runController = MessageUIFactory.createInfoMessage(ureq, wControl, "", trans.translate("error.onyx"));
    } else {
        RepositoryEntry testEntry = getReferencedRepositoryEntry();
        if (ImsQTI21Resource.TYPE_NAME.equals(testEntry.getOlatResource().getResourceableTypeName())) {
            runController = new QTI21AssessmentRunController(ureq, wControl, userCourseEnv, this);
        } else {
            IQSecurityCallback sec = new CourseIQSecurityCallback(this, am, ureq.getIdentity());
            runController = new IQRunController(userCourseEnv, getModuleConfiguration(), sec, ureq, wControl, this);
        }
    }
    Controller ctrl = TitledWrapperHelper.getWrapper(ureq, wControl, runController, this, "o_iqself_icon");
    return new NodeRunConstructionResult(ctrl);
}
Also used : QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) ModuleConfiguration(org.olat.modules.ModuleConfiguration) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback) IQRunController(org.olat.course.nodes.iq.IQRunController) Translator(org.olat.core.gui.translator.Translator) PackageTranslator(org.olat.core.gui.translator.PackageTranslator) AssessmentManager(org.olat.course.assessment.AssessmentManager) IQSecurityCallback(org.olat.modules.iq.IQSecurityCallback) CourseIQSecurityCallback(org.olat.course.nodes.iq.CourseIQSecurityCallback) RepositoryEntry(org.olat.repository.RepositoryEntry) QTI21AssessmentRunController(org.olat.course.nodes.iq.QTI21AssessmentRunController) IQEditController(org.olat.course.nodes.iq.IQEditController) NodeEditController(org.olat.course.editor.NodeEditController) TabbableController(org.olat.core.gui.control.generic.tabbable.TabbableController) Controller(org.olat.core.gui.control.Controller) IQRunController(org.olat.course.nodes.iq.IQRunController) NodeRunConstructionResult(org.olat.course.run.navigation.NodeRunConstructionResult)

Example 85 with Translator

use of org.olat.core.gui.translator.Translator 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;
}
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)

Aggregations

Translator (org.olat.core.gui.translator.Translator)586 Identity (org.olat.core.id.Identity)62 Date (java.util.Date)54 Controller (org.olat.core.gui.control.Controller)54 RepositoryEntry (org.olat.repository.RepositoryEntry)54 Locale (java.util.Locale)52 PackageTranslator (org.olat.core.gui.translator.PackageTranslator)46 ArrayList (java.util.ArrayList)40 TabbableController (org.olat.core.gui.control.generic.tabbable.TabbableController)40 NodeEditController (org.olat.course.editor.NodeEditController)40 TitleItem (org.olat.core.commons.services.notifications.model.TitleItem)36 Roles (org.olat.core.id.Roles)36 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)36 SubscriptionListItem (org.olat.core.commons.services.notifications.model.SubscriptionListItem)32 Publisher (org.olat.core.commons.services.notifications.Publisher)30 SubscriptionInfo (org.olat.core.commons.services.notifications.SubscriptionInfo)30 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)30 MailBundle (org.olat.core.util.mail.MailBundle)28 ICourse (org.olat.course.ICourse)26 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)26