コード例 #1
0
  public AssessedIdentityRepositoryEntryController(
      UserRequest ureq,
      WindowControl wControl,
      TooledStackedPanel stackPanel,
      RepositoryEntry assessableEntry,
      Identity assessedIdentity,
      AssessableResource element) {
    super(ureq, wControl);

    this.stackPanel = stackPanel;
    this.assessedIdentity = assessedIdentity;

    identityAssessmentVC = createVelocityContainer("identity_personal_infos");
    identityAssessmentVC.contextPut("user", assessedIdentity.getUser());

    infosController = new AssessedIdentityLargeInfosController(ureq, wControl, assessedIdentity);
    listenTo(infosController);
    identityAssessmentVC.put("identityInfos", infosController.getInitialComponent());

    RepositoryHandler handler = repositoryHandlerFactory.getRepositoryHandler(assessableEntry);
    if (handler.supportsAssessmentDetails()) {
      detailsCtrl =
          handler.createAssessmentDetailsController(
              assessableEntry, ureq, getWindowControl(), stackPanel, assessedIdentity);
      listenTo(detailsCtrl);
      identityAssessmentVC.put("details", detailsCtrl.getInitialComponent());
    }

    assessmentForm =
        new AssessmentForm(ureq, getWindowControl(), assessedIdentity, assessableEntry, element);
    listenTo(assessmentForm);
    identityAssessmentVC.put("assessmentForm", assessmentForm.getInitialComponent());

    putInitialPanel(identityAssessmentVC);
  }
コード例 #2
0
 public void setElementCSSClass(String cssClass) {
   if (StringHelper.containsNonWhitespace(cssClass)) {
     wrapper.contextPut("cssClass", cssClass);
   } else {
     wrapper.contextRemove("cssClass");
   }
 }
コード例 #3
0
  public GuiDemoTooltipsController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);

    Link button = LinkFactory.createButton("button", content, this);
    button.setTooltip("tooltip.content");
    Link linkT = LinkFactory.createLink("linkT", content, this);
    linkT.setTooltip("tooltip.content");
    Link link1 = LinkFactory.createLink("link1", content, this);
    link1.setTooltip("tooltip.content");
    Link link2 = LinkFactory.createLink("link2", content, this);
    link2.setTooltip("tooltip.content");

    // link with component content

    /**
     * works when passing a custom html id like id="blalala" and then fetching the content from this
     * id with getElementById("id").innerHTML but with the component the component is not invisible
     * and gets renderer somewhere and somehow not
     */
    LinkFactory.createLink("link3", content, this);
    content.put("tooltipContent", tooltipContent);
    link4 = LinkFactory.createLink("link4", tooltipContent, this);

    // add source view control
    Controller sourceview = new SourceViewController(ureq, wControl, this.getClass(), content);
    content.put("sourceview", sourceview.getInitialComponent());

    putInitialPanel(content);
  }
コード例 #4
0
 /*
  * (non-Javadoc)
  * @see org.olat.core.gui.control.GuiStack#pushModalDialog(java.lang.String, org.olat.core.gui.components.Component)
  */
 @Override
 public void pushModalDialog(Component content) {
   // wrap the component into a modal foreground dialog with alpha-blended-background
   VelocityContainer inset =
       new VelocityContainer("simpleinset", VELOCITY_ROOT + "/simpleinset.html", null, null);
   inset.put("cont", content);
   contentPanel.pushContent(inset);
 }
コード例 #5
0
  protected void loadModel() {
    Statistics statistics = dbInstance.getStatistics();
    mainVC.contextPut("isStatisticsEnabled", statistics.isStatisticsEnabled());
    mainVC.contextPut("hibernateStatistics", statistics);

    DatabaseConnectionVO connectionInfos = databaseStatsManager.getConnectionInfos();
    mainVC.contextPut("connectionInfos", connectionInfos);
  }
  /**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
   *     org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  @Override
  public void event(final UserRequest ureq, final Component source, final Event event) {
    if (source == myEntriesLink) {
      searchCtr.doSearchByOwnerLimitType(ureq.getIdentity(), limitTypes);
      mainVC.contextPut("subtitle", translate("referencableSearch." + CMD_MY_ENTRIES));
      myEntriesLink.setCustomEnabledLinkCSS("b_selected");
      allEntriesLink.removeCSS();
      searchEntriesLink.removeCSS();
    }
    if (source == allEntriesLink) {
      searchCtr.doSearchForReferencableResourcesLimitType(
          ureq.getIdentity(), limitTypes, ureq.getUserSession().getRoles());
      mainVC.contextPut("subtitle", translate("referencableSearch." + CMD_ALL_ENTRIES));
      allEntriesLink.setCustomEnabledLinkCSS("b_selected");
      myEntriesLink.removeCSS();
      searchEntriesLink.removeCSS();
    }
    if (source == searchEntriesLink) {
      mainVC.contextPut("subtitle", translate("referencableSearch." + CMD_SEARCH_ENTRIES));
      // start with search view
      searchCtr.displaySearchForm();
      mainVC.contextPut("subtitle", translate("referencableSearch." + CMD_SEARCH));

      searchEntriesLink.setCustomEnabledLinkCSS("b_selected");
      myEntriesLink.removeCSS();
      allEntriesLink.removeCSS();
    }
    if (source == createRessourceButton) {

      removeAsListenerAndDispose(addController);
      addController =
          new RepositoryAddController(ureq, getWindowControl(), getAction(ACTION_CREATE));
      listenTo(addController);

      removeAsListenerAndDispose(cmc);
      cmc =
          new CloseableModalController(
              getWindowControl(), translate("close"), addController.getInitialComponent());
      listenTo(cmc);

      cmc.activate();
    }
    if (source == importRessourceButton) {

      removeAsListenerAndDispose(addController);
      addController =
          new RepositoryAddController(ureq, getWindowControl(), getAction(ACTION_IMPORT));
      listenTo(addController);

      removeAsListenerAndDispose(cmc);
      cmc =
          new CloseableModalController(
              getWindowControl(), translate("close"), addController.getInitialComponent());
      listenTo(cmc);

      cmc.activate();
    }
  }
コード例 #7
0
 private void initQuotaForm(UserRequest ureq, Quota quota) {
   if (quotaForm != null) {
     removeAsListenerAndDispose(quotaForm);
   }
   quotaForm = new QuotaForm(ureq, getWindowControl(), quota, true);
   listenTo(quotaForm);
   myContent.put("quotaform", quotaForm.getInitialComponent());
   myContent.contextPut("editQuota", Boolean.TRUE);
 }
コード例 #8
0
 private void updateStatisticUpdateOngoingFlag() {
   StatisticUpdateManager statisticUpdateManager = getStatisticUpdateManager();
   if (statisticUpdateManager == null) {
     log_.info("event: UpdateStatisticsJob configured, but no StatisticManager available");
     content.contextPut("statisticUpdateOngoing", Boolean.TRUE);
   } else {
     content.contextPut("statisticUpdateOngoing", statisticUpdateManager.updateOngoing());
   }
 }
コード例 #9
0
  private void refreshUIState() {
    boolean enabled = false;
    String cronExpression = "";
    if (CoreSpringFactory.containsBean("schedulerFactoryBean")) {
      log_.info("refreshUIState: schedulerFactoryBean found");
      Object schedulerFactoryBean = CoreSpringFactory.getBean("schedulerFactoryBean");
      if (schedulerFactoryBean != null && schedulerFactoryBean instanceof Scheduler) {
        Scheduler schedulerBean = (Scheduler) schedulerFactoryBean;
        int triggerState;
        try {
          triggerState =
              schedulerBean.getTriggerState("updateStatisticsTrigger", null /*trigger group*/);
          enabled = (triggerState != Trigger.STATE_NONE) && (triggerState != Trigger.STATE_ERROR);
          log_.info(
              "refreshUIState: updateStatisticsTrigger state was "
                  + triggerState
                  + ", enabled now: "
                  + enabled);
        } catch (SchedulerException e) {
          log_.warn(
              "refreshUIState: Got a SchedulerException while asking for the updateStatisticsTrigger's state",
              e);
        }
      }
      CronTriggerBean triggerBean =
          (CronTriggerBean) CoreSpringFactory.getBean("updateStatisticsTrigger");
      JobDetail jobDetail = triggerBean.getJobDetail();
      enabled &= jobDetail.getName().equals("org.olat.statistics.job.enabled");
      log_.info("refreshUIState: org.olat.statistics.job.enabled check, enabled now: " + enabled);
      cronExpression = triggerBean.getCronExpression();
      StatisticUpdateManager statisticUpdateManager = getStatisticUpdateManager();
      if (statisticUpdateManager == null) {
        log_.info("refreshUIState: statisticUpdateManager not configured");
        enabled = false;
      } else {
        enabled &= statisticUpdateManager.isEnabled();
        log_.info("refreshUIState: statisticUpdateManager configured, enabled now: " + enabled);
      }
    } else {
      log_.info("refreshUIState: schedulerFactoryBean not found");
    }
    if (enabled) {
      content.contextPut(
          "status",
          getTranslator().translate("statistics.status.enabled", new String[] {cronExpression}));
    } else {
      content.contextPut("status", getTranslator().translate("statistics.status.disabled"));
    }
    content.contextPut("statisticEnabled", enabled);

    recalcLastUpdated();

    updateStatisticUpdateOngoingFlag();
  }
コード例 #10
0
 private void initializeContent() {
   updateUserList();
   VelocityContainer readyToDeleteContent = createVelocityContainer("readyToDelete");
   readyToDeleteContent.put("readyToDelete", tableCtr.getInitialComponent());
   readyToDeleteContent.contextPut(
       "header",
       translate(
           "ready.to.delete.header",
           Integer.toString(UserDeletionManager.getInstance().getDeleteEmailDuration())));
   readyToDeletePanel.setContent(readyToDeleteContent);
 }
コード例 #11
0
  private void showExportOngoing(final boolean thisCourse) {
    VelocityContainer vcOngoing = createVelocityContainer("courselogs_ongoing");
    if (thisCourse) {
      vcOngoing.contextPut("body", translate("course.logs.ongoing"));
    } else {
      // more generic message that makes also sense in other courses
      vcOngoing.contextPut("body", translate("course.logs.busy"));
    }
    myPanel.setContent(vcOngoing);

    // initialize polling
    // myPanel.put("updatecontrol", new JSAndCSSComponent("intervall", this.getClass(), 3000));
  }
コード例 #12
0
ファイル: IQRunController.java プロジェクト: klemens/openolat
 private void checkChats(UserRequest ureq) {
   List<?> allChats = null;
   if (ureq != null) {
     allChats = ureq.getUserSession().getChats();
   }
   if (allChats == null || allChats.size() == 0) {
     startButton.setEnabled(true);
     myContent.contextPut("hasChatWindowOpen", false);
   } else {
     startButton.setEnabled(false);
     myContent.contextPut("hasChatWindowOpen", true);
   }
 }
コード例 #13
0
ファイル: IQRunController.java プロジェクト: klemens/openolat
  /**
   * Constructor for a test run controller
   *
   * @param userCourseEnv
   * @param moduleConfiguration
   * @param secCallback
   * @param ureq
   * @param wControl
   * @param testCourseNode
   */
  public IQRunController(
      UserCourseEnvironment userCourseEnv,
      ModuleConfiguration moduleConfiguration,
      IQSecurityCallback secCallback,
      UserRequest ureq,
      WindowControl wControl,
      IQTESTCourseNode testCourseNode,
      RepositoryEntry testEntry) {

    super(ureq, wControl, Util.createPackageTranslator(CourseNode.class, ureq.getLocale()));

    this.modConfig = moduleConfiguration;
    this.secCallback = secCallback;
    this.userCourseEnv = userCourseEnv;
    this.courseNode = testCourseNode;
    this.type = AssessmentInstance.QMD_ENTRY_TYPE_ASSESS;
    this.singleUserEventCenter = ureq.getUserSession().getSingleUserEventCenter();
    this.referenceTestEntry = testEntry;

    this.userSession = ureq.getUserSession();

    addLoggingResourceable(LoggingResourceable.wrap(courseNode));

    myContent = createVelocityContainer("testrun");

    mainPanel = putInitialPanel(myContent);

    if (!modConfig
        .get(IQEditController.CONFIG_KEY_TYPE)
        .equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) {
      throw new OLATRuntimeException(
          "IQRunController launched with Test constructor but module configuration not configured as test",
          null);
    }
    init(ureq);
    exposeUserTestDataToVC(ureq);

    StringBuilder qtiChangelog = createChangelogMsg(ureq);
    // decide about changelog in VC
    if (qtiChangelog.length() > 0) {
      // there is some message
      myContent.contextPut("changeLog", qtiChangelog);
    }

    // if show results on test home page configured - show log
    Boolean showResultOnHomePage =
        testCourseNode
            .getModuleConfiguration()
            .getBooleanEntry(IQEditController.CONFIG_KEY_RESULT_ON_HOME_PAGE);
    myContent.contextPut("showChangelog", showResultOnHomePage);
  }
コード例 #14
0
  protected ShibLoginPortletRunController(
      UserRequest ureq, WindowControl wControl, SwitchShibbolethAuthenticationConfigurator config) {
    super(ureq, wControl);

    this.portletVC = createVelocityContainer("portlet");

    portletVC.contextPut("wayfSPEntityID", config.getWayfSPEntityID());
    portletVC.contextPut("wayfSPHandlerURL", config.getWayfSPHandlerURL());
    portletVC.contextPut("wayfSPSamlDSURL", config.getWayfSPSamlDSURL());
    portletVC.contextPut("wayfReturnUrl", config.getWayfReturnUrl());
    portletVC.contextPut("additionalIDPs", config.getAdditionalIdentityProviders());

    setInitialComponent(this.portletVC);
  }
コード例 #15
0
  protected void showExportFinished() {
    ICourse course = CourseFactory.loadCourse(ores);
    VelocityContainer vcFeedback = createVelocityContainer("courselogs_feedback");
    showFileButton = LinkFactory.createButton("showfile", vcFeedback, this);
    vcFeedback.contextPut("body", translate("course.logs.feedback", course.getCourseTitle()));
    myPanel.setContent(vcFeedback);

    // note: polling can't be switched off unfortunatelly
    //       this is due to the fact that the jsandcsscomponent can only modify
    //       certain parts of the page and it would require a full page refresh
    //       to get rid of the poller - and that's not possible currently

    showInfo("course.logs.finished", course.getCourseTitle());
  }
コード例 #16
0
  private Controller selectMenuItem(UserRequest ureq, String cmd) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(cmd, 0l);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(
        LoggingResourceable.wrapBusinessPath(ores));
    WindowControl bwControl =
        BusinessControlFactory.getInstance()
            .createBusinessWindowControl(ores, null, getWindowControl());
    addToHistory(ureq, bwControl);

    Controller selectedCtrl = null;
    if (CMD_MEMBERS.equals(cmd)) {
      if (membersOverviewCtrl == null) {
        membersOverviewCtrl = new MembersOverviewController(ureq, bwControl, repoEntry);
        listenTo(membersOverviewCtrl);
      }
      mainVC.put("content", membersOverviewCtrl.getInitialComponent());
      selectedCtrl = membersOverviewCtrl;
    } else if (CMD_GROUPS.equals(cmd)) {
      if (groupsCtrl == null) {
        groupsCtrl = new CourseBusinessGroupListController(ureq, bwControl, repoEntry);
        listenTo(groupsCtrl);
      }
      groupsCtrl.reloadModel();
      mainVC.put("content", groupsCtrl.getInitialComponent());
      selectedCtrl = groupsCtrl;
    } else if (CMD_BOOKING.equals(cmd)) {
      if (ordersController == null) {
        ordersController = new OrdersAdminController(ureq, bwControl, repoEntry.getOlatResource());
        listenTo(ordersController);
      }
      mainVC.put("content", ordersController.getInitialComponent());
      selectedCtrl = ordersController;
    } else if (CMD_RIGHTS.equals(cmd)) {
      if (rightsController == null) {
        rightsController =
            new GroupsAndRightsController(ureq, bwControl, repoEntry.getOlatResource());
        listenTo(rightsController);
      }
      mainVC.put("content", rightsController.getInitialComponent());
      selectedCtrl = rightsController;
    }

    TreeNode selTreeNode =
        TreeHelper.findNodeByUserObject(cmd, menuTree.getTreeModel().getRootNode());
    if (selTreeNode != null && !selTreeNode.getIdent().equals(menuTree.getSelectedNodeId())) {
      menuTree.setSelectedNodeId(selTreeNode.getIdent());
    }
    return selectedCtrl;
  }
コード例 #17
0
  private void createRemovedNotificationMail(UserRequest ureq, String subjectStr) {
    MailTemplate mailTempl = denManager.getRemovedMailTemplate(ureq, subjectStr, getTranslator());
    removeAsListenerAndDispose(addedNotificationCtr);
    addedNotificationCtr =
        new MailNotificationEditController(getWindowControl(), ureq, mailTempl, false, false, true);
    listenTo(addedNotificationCtr);

    VelocityContainer sendNotificationVC = createVelocityContainer("sendnotification");
    sendNotificationVC.put("notificationForm", addedNotificationCtr.getInitialComponent());
    removeAsListenerAndDispose(notificationCmc);
    notificationCmc = new CloseableModalController(getWindowControl(), "close", sendNotificationVC);
    listenTo(notificationCmc);

    notificationCmc.activate();
  }
コード例 #18
0
  /**
   * Constructor for the course logs archive controller
   *
   * @param ureq
   * @param wControl
   * @param course
   */
  public CourseLogsArchiveController(
      UserRequest ureq, WindowControl wControl, OLATResourceable ores) {
    super(ureq, wControl);
    this.ores = ores;
    this.myPanel = new Panel("myPanel");
    myPanel.addListener(this);

    myContent = createVelocityContainer("start_courselogs");

    Identity identity = ureq.getIdentity();
    Roles roles = ureq.getUserSession().getRoles();

    RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false);
    boolean isOLATAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isOresOwner = RepositoryManager.getInstance().isOwnerOfRepositoryEntry(identity, re);
    boolean isOresInstitutionalManager =
        RepositoryManager.getInstance().isInstitutionalRessourceManagerFor(identity, roles, re);
    boolean aLogV = isOresOwner || isOresInstitutionalManager;
    boolean uLogV = isOLATAdmin;
    boolean sLogV = isOresOwner || isOresInstitutionalManager;

    if (AsyncExportManager.getInstance().asyncArchiveCourseLogOngoingFor(ureq.getIdentity())) {
      // then show the ongoing feedback
      showExportOngoing(false);
    } else if (isOLATAdmin || aLogV || uLogV || sLogV) {
      myContent.contextPut("hasLogArchiveAccess", true);
      logFileChooserForm = new LogFileChooserForm(ureq, wControl, isOLATAdmin, aLogV, uLogV, sLogV);
      listenTo(logFileChooserForm);
      myContent.put("logfilechooserform", logFileChooserForm.getInitialComponent());
      ICourse course = CourseFactory.loadCourse(ores);
      myContent.contextPut(
          "body", translate("course.logs.existingarchiveintro", course.getCourseTitle()));
      showFileButton = LinkFactory.createButton("showfile", myContent, this);
      File exportDir =
          CourseFactory.getDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
      boolean exportDirExists = false;
      if (exportDir != null && exportDir.exists() && exportDir.isDirectory()) {
        exportDirExists = true;
      }
      myContent.contextPut("hascourselogarchive", new Boolean(exportDirExists));
      myPanel.setContent(myContent);
    } else {
      myContent.contextPut("hasLogArchiveAccess", new Boolean(false));
      myPanel.setContent(myContent);
    }

    putInitialPanel(myPanel);
  }
コード例 #19
0
 /**
  * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
  *     org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
  */
 public void event(UserRequest ureq, Component source, Event event) {
   initQuotaForm(ureq, currentQuota);
   if (source == delQuotaButton) {
     boolean deleted = QuotaManager.getInstance().deleteCustomQuota(currentQuota);
     if (deleted) {
       myContent.remove(quotaForm.getInitialComponent());
       myContent.contextPut("editQuota", Boolean.FALSE);
       showInfo("qf.deleted", currentQuota.getPath());
       fireEvent(ureq, Event.CHANGED_EVENT);
     } else {
       showError("qf.cannot.del.default");
     }
   } else if (source == cancelButton) {
     fireEvent(ureq, Event.CANCELLED_EVENT);
   }
 }
コード例 #20
0
  /**
   * @param ureq
   * @param wControl
   * @param cancelbutton
   */
  public ReadyToDeleteController(UserRequest ureq, WindowControl wControl) {

    super(ureq, wControl);

    Translator fallbackTrans =
        Util.createPackageTranslator(UserSearchController.class, ureq.getLocale());
    setTranslator(
        Util.createPackageTranslator(
            ReadyToDeleteController.class, ureq.getLocale(), fallbackTrans));
    //	use the PropertyHandlerTranslator	as tableCtr translator
    propertyHandlerTranslator =
        UserManager.getInstance().getPropertyHandlerTranslator(getTranslator());

    myContent = createVelocityContainer("panel");
    readyToDeletePanel = new Panel("readyToDeletePanel");
    readyToDeletePanel.addListener(this);
    myContent.put("panel", readyToDeletePanel);

    Roles roles = ureq.getUserSession().getRoles();
    isAdministrativeUser =
        CoreSpringFactory.getImpl(BaseSecurityModule.class).isUserAllowedAdminProps(roles);
    // (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());

    initializeTableController(ureq);
    initializeContent();
    putInitialPanel(myContent);
  }
コード例 #21
0
  /**
   * @see org.olat.login.auth.AuthenticationController#init(org.olat.core.gui.UserRequest,
   *     org.olat.core.gui.control.WindowControl)
   */
  public OLATAuthenticationController(UserRequest ureq, WindowControl winControl) {
    // use fallback translator to registration module
    super(
        ureq,
        winControl,
        Util.createPackageTranslator(RegistrationManager.class, ureq.getLocale()));

    loginComp = createVelocityContainer("olat_log", "olatlogin");

    if (userModule.isAnyPasswordChangeAllowed()) {
      pwLink = LinkFactory.createLink("_olat_login_change_pwd", "menu.pw", loginComp, this);
      pwLink.setElementCssClass("o_login_pwd");
    }

    if (registrationModule.isSelfRegistrationEnabled()
        && registrationModule.isSelfRegistrationLoginEnabled()) {
      registerLink =
          LinkFactory.createLink("_olat_login_register", "menu.register", loginComp, this);
      registerLink.setElementCssClass("o_login_register");
      registerLink.setTitle("menu.register.alt");
    }

    // prepare login form
    loginForm = new OLATAuthentcationForm(ureq, winControl, "olat_login", getTranslator());
    listenTo(loginForm);

    loginComp.put("loginForm", loginForm.getInitialComponent());

    // Check if form is triggered by external loginworkflow that has been failed
    if (ureq.getParameterSet().contains(PARAM_LOGINERROR)) {
      showError(translate("login.error", WebappHelper.getMailConfig("mailReplyTo")));
    }

    putInitialPanel(loginComp);
  }
コード例 #22
0
 private void doOpenThreads(UserRequest ureq) {
   if (threadsCtrl == null) {
     threadsCtrl = new JavaThreadsController(ureq, getWindowControl());
     listenTo(threadsCtrl);
   }
   mainVC.put("segmentCmp", threadsCtrl.getInitialComponent());
 }
コード例 #23
0
ファイル: IQRunController.java プロジェクト: klemens/openolat
 private void exposeUserQuestionnaireDataToVC() {
   AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
   Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
   // although this is not an assessable node we still use the assessment
   // manager since this one uses caching
   myContent.contextPut("attempts", am.getNodeAttempts(courseNode, identity));
 }
コード例 #24
0
 private void doOpenEnvProps(UserRequest ureq) {
   if (envPropsCtrl == null) {
     envPropsCtrl = new JavaEnvironmmentPropertiesController(ureq, getWindowControl());
     listenTo(envPropsCtrl);
   }
   mainVC.put("segmentCmp", envPropsCtrl.getInitialComponent());
 }
コード例 #25
0
ファイル: LockController.java プロジェクト: nagyist/openolat
  /**
   * Controls locks in admin view.
   *
   * @param ureq
   * @param wControl
   */
  public LockController(UserRequest ureq, WindowControl wControl) {
    super(ureq, wControl);

    myContent = createVelocityContainer("locks");

    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setDownloadOffered(false);
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
    tableCtr.addColumnDescriptor(
        new DefaultColumnDescriptor("lock.key", Cols.key.ordinal(), null, getLocale()));

    BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
    if (securityModule.isUserAllowedAdminProps(ureq.getUserSession().getRoles())) {
      tableCtr.addColumnDescriptor(
          new DefaultColumnDescriptor("lock.owner", Cols.ownerName.ordinal(), null, getLocale()));
    }
    tableCtr.addColumnDescriptor(
        new DefaultColumnDescriptor("lock.owner", Cols.ownerFullname.ordinal(), null, getLocale()));
    tableCtr.addColumnDescriptor(
        new DefaultColumnDescriptor(
            "lock.aquiretime", Cols.acquiredTime.ordinal(), null, getLocale()));
    tableCtr.addColumnDescriptor(
        new StaticColumnDescriptor("lock.release", "lock.release", translate("lock.release")));
    listenTo(tableCtr);
    resetTableModel();
    myContent.put("locktable", tableCtr.getInitialComponent());
    putInitialPanel(myContent);
  }
コード例 #26
0
  /**
   * Constructor for the email
   *
   * @param wControl
   * @param ureq
   * @param mailTemplate
   * @param useCancel
   */
  public BGMailNotificationEditController(
      WindowControl wControl,
      UserRequest ureq,
      MailTemplate mailTemplate,
      boolean ccSenderAllowed,
      boolean customizingAvailable,
      boolean useCancel,
      boolean mandatory) {
    super(ureq, wControl);
    this.mailTemplate = mailTemplate;
    orgMailSubject = mailTemplate.getSubjectTemplate();
    orgMailBody = mailTemplate.getBodyTemplate();
    cpFrom = mailTemplate.getCpfrom();

    mainVC = createVelocityContainer("mailnotification");
    mailForm =
        new BGMailTemplateController(
            ureq,
            wControl,
            mailTemplate,
            ccSenderAllowed,
            customizingAvailable,
            useCancel,
            mandatory);
    listenTo(mailForm);

    mainVC.put("mailForm", mailForm.getInitialComponent());

    putInitialPanel(mainVC);
  }
コード例 #27
0
 private void doOpenMemory(UserRequest ureq) {
   if (memoryCtrl == null) {
     memoryCtrl = new JavaMemoryController(ureq, getWindowControl());
     listenTo(memoryCtrl);
   }
   mainVC.put("segmentCmp", memoryCtrl.getInitialComponent());
 }
コード例 #28
0
  public GoToMeetingController(
      UserRequest ureq,
      WindowControl wControl,
      GoToMeeting meeting,
      boolean administrator,
      boolean moderator,
      boolean readOnly) {
    super(ureq, wControl);
    this.readOnly = readOnly;
    this.moderator = moderator;
    this.administrator = administrator;

    mainVC = createVelocityContainer("meeting");
    mainVC.contextPut("title", meeting.getName());
    mainVC.contextPut("description", meeting.getDescription());

    if (administrator || moderator) {
      startLink = LinkFactory.createButtonLarge("training.start", mainVC, this);
      startLink.setTarget("_blank");
    }
    registerLink = LinkFactory.createButtonLarge("training.register", mainVC, this);
    confirmLink = LinkFactory.createButtonLarge("training.confirm", mainVC, this);
    confirmLink.setTarget("_blank");
    joinLink = LinkFactory.createButtonLarge("training.join", mainVC, this);
    joinLink.setTarget("_blank");

    openRecordingsLink = LinkFactory.createButton("recordings", mainVC, this);

    GoToError error = new GoToError();
    this.meeting = meetingMgr.getMeeting(meeting, error);
    this.registrant = meetingMgr.getRegistrant(meeting, getIdentity());
    if (error.hasError() && error.getError() != null) {
      mainVC.contextPut("errorMessage", translate(error.getError().i18nKey()));
    }

    List<GoToRecordingsG2T> recordings = meetingMgr.getRecordings(meeting, error);
    openRecordingsLink.setVisible(recordings != null && recordings.size() > 0);

    Date start = meeting.getStartDate();
    Date end = meeting.getEndDate();
    Formatter formatter = Formatter.getInstance(getLocale());
    mainVC.contextPut("start", formatter.formatDateAndTime(start));
    mainVC.contextPut("end", formatter.formatDateAndTime(end));

    putInitialPanel(mainVC);
    updateButtons();
  }
コード例 #29
0
  public MoveCopySubtreeController(
      UserRequest ureq,
      WindowControl wControl,
      OLATResourceable ores,
      CourseEditorTreeNode moveCopyFrom,
      boolean copy) {
    super(ureq, wControl);
    this.ores = ores;
    this.moveCopyFrom = moveCopyFrom;
    this.copy = copy;

    ICourse course = CourseFactory.getCourseEditSession(ores.getResourceableId());
    addLoggingResourceable(LoggingResourceable.wrap(course));
    addLoggingResourceable(LoggingResourceable.wrap(moveCopyFrom.getCourseNode()));

    insertTree = new MenuTree(null, "copy_node_selection", this);
    insertTree.enableInsertTool(true);
    insertModel = new InsertTreeModel(course.getEditorTreeModel().getRootNode(), moveCopyFrom);
    insertTree.setTreeModel(insertModel);

    VelocityContainer mainVC = createVelocityContainer("moveCopyNode");

    selectButton = LinkFactory.createButton("insertAtSelectedTreepos", mainVC, this);
    selectButton.setCustomEnabledLinkCSS("btn btn-primary");
    selectButton.setCustomDisabledLinkCSS("btn btn-default");
    selectButton.setEnabled(false);
    cancelButton = LinkFactory.createButton("cancel", mainVC, this);

    int numOfNodes = TreeHelper.totalNodeCount(insertModel.getRootNode());
    if (numOfNodes > CourseModule.getCourseNodeLimit()) {
      String msg =
          getTranslator()
              .translate(
                  "warning.containsXXXormore.nodes",
                  new String[] {
                    String.valueOf(numOfNodes),
                    String.valueOf(CourseModule.getCourseNodeLimit() + 1)
                  });
      Controller tmp = MessageUIFactory.createWarnMessage(ureq, wControl, null, msg);
      listenTo(tmp);
      mainVC.put("nodelimitexceededwarning", tmp.getInitialComponent());
    }

    mainVC.put("selection", insertTree);
    putInitialPanel(mainVC);
  }
コード例 #30
0
ファイル: IQRunController.java プロジェクト: klemens/openolat
  /**
   * Provides the self test score and results, if any, to the velocity container.
   *
   * @param ureq
   */
  private void exposeUserSelfTestDataToVC(UserRequest ureq) {
    // config : show score info
    Object enableScoreInfoObject = modConfig.get(IQEditController.CONFIG_KEY_ENABLESCOREINFO);
    if (enableScoreInfoObject != null) {
      myContent.contextPut("enableScoreInfo", enableScoreInfoObject);
    } else {
      myContent.contextPut("enableScoreInfo", Boolean.TRUE);
    }

    if (!(courseNode instanceof SelfAssessableCourseNode))
      throw new AssertException(
          "exposeUserSelfTestDataToVC can only be called for selftest nodes, not for test or questionnaire");
    SelfAssessableCourseNode acn = (SelfAssessableCourseNode) courseNode;
    ScoreEvaluation scoreEval = acn.getUserScoreEvaluation(userCourseEnv);
    if (scoreEval != null) {
      myContent.contextPut("hasResults", Boolean.TRUE);
      myContent.contextPut("score", AssessmentHelper.getRoundedScore(scoreEval.getScore()));
      myContent.contextPut(
          "hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
      myContent.contextPut("passed", scoreEval.getPassed());
      myContent.contextPut("attempts", new Integer(1)); // at least one attempt

      exposeResults(ureq);
    }
  }