Package org.olat.modules

Examples of org.olat.modules.ModuleConfiguration


  /**
   * @see org.olat.course.nodes.AssessableCourseNode#hasScoreConfigured()
   */
  public boolean hasScoreConfigured() {
    ModuleConfiguration config = getModuleConfiguration();
    Boolean score = (Boolean) config.get(CONFIG_KEY_HAS_SCORE_FIELD);
    if (score == null) return false;
    return score.booleanValue();
  }
View Full Code Here


  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
   */
  public Float getMaxScoreConfiguration() {
    if (!hasScoreConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getMaxScore not defined when hasScore set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float max = (Float) config.get(CONFIG_KEY_SCORE_MAX);
    return max;
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
   */
  public Float getMinScoreConfiguration() {
    if (!hasScoreConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getMinScore not defined when hasScore set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float min = (Float) config.get(CONFIG_KEY_SCORE_MIN);
    return min;
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  public Float getCutValueConfiguration() {
    if (!hasPassedConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getCutValue not defined when hasPassed set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float cut = (Float) config.get(CONFIG_KEY_PASSED_CUT_VALUE);
    return cut;
  }
View Full Code Here

  private void init(UserRequest ureq, CalCourseNode courseNode, UserCourseEnvironment courseEnv) {
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseEnvironment().getCourseResourceableId());
    CourseCalendars myCal = CourseCalendars.createCourseCalendarsWrapper(ureq, getWindowControl(), course);

    Date refDate;
    ModuleConfiguration config = courseNode.getModuleConfiguration();
    if (CalEditController.getAutoDate(config)) {
      refDate = new Date();
    } else {
      refDate = CalEditController.getStartDate(config);
      if (refDate == null) refDate = new Date();
View Full Code Here

   * @param isNewNode true: an initial configuration is set; false: upgrading
   *          from previous node configuration version, set default to maintain
   *          previous behaviour
   */
  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
      // add default module configuration
      config.set(IQEditController.CONFIG_KEY_ENABLEMENU, new Boolean(true));
      config.set(IQEditController.CONFIG_KEY_SEQUENCE, AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM);
      config.set(IQEditController.CONFIG_KEY_TYPE, AssessmentInstance.QMD_ENTRY_TYPE_SURVEY);
      config.set(IQEditController.CONFIG_KEY_SUMMARY, AssessmentInstance.QMD_ENTRY_SUMMARY_NONE); // not used in survey
    }
  }
View Full Code Here

    super(wControl);
    PackageTranslator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
   
    myContent = new VelocityContainer("olatmsrun", VELOCITY_ROOT + "/run.html", trans, this);
   
    ModuleConfiguration config = msCourseNode.getModuleConfiguration();
    myContent.contextPut("displayNodeInfo", Boolean.valueOf(displayNodeInfo));
    if (displayNodeInfo) {
      // push title and learning objectives, only visible on intro page
      myContent.contextPut("menuTitle", msCourseNode.getShortTitle());
      myContent.contextPut("displayTitle", msCourseNode.getLongTitle());
View Full Code Here

    List condErrs = isConfigValidWithTranslator(cev, translatorStr, getConditionExpressions());
    List missingNames = new ArrayList();
    /*
     * check group and area names for existence
     */
    ModuleConfiguration mc = getModuleConfiguration();
    String areaStr = (String) mc.get(CONFIG_AREANAME);
    String nodeId = getIdent();
    if (areaStr != null) {
      String[] areas = areaStr.split(",");
      for (int i = 0; i < areas.length; i++) {
        String trimmed = areas[i] != null ? areas[i].trim() : areas[i];
        if (!trimmed.equals("") && !cev.existsArea(trimmed)) {
          StatusDescription sd = new StatusDescription(StatusDescription.WARNING, "error.notfound.name", "solution.checkgroupmanagement",
              new String[] { "NONE", trimmed }, translatorStr);
          sd.setDescriptionForUnit(nodeId);
          missingNames.add(sd);
        }
      }
    }
    String groupStr = (String) mc.get(CONFIG_GROUPNAME);
    if (groupStr != null) {
      String[] groups = groupStr.split(",");
      for (int i = 0; i < groups.length; i++) {
        String trimmed = groups[i] != null ? groups[i].trim() : groups[i];
        if (!trimmed.equals("") && !cev.existsGroup(trimmed)) {
View Full Code Here

 
  /**
   * Init config parameter with default values for a new course node.
   */
  private void initDefaultConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    // defaults
    config.set(CONF_CANCEL_ENROLL_ENABLED, Boolean.TRUE);
    config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
  }
View Full Code Here

  }
  /**
   * Migrate (add new config parameter/values) config parameter for a existing course node.
   */
  private void migrateConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    int version = config.getConfigurationVersion();
    if (version < CURRENT_CONFIG_VERSION) {
      // Loaded config is older than current config version => migrate
      if (version == 1) {
        // migrate V1 => V2
        config.set(CONF_CANCEL_ENROLL_ENABLED, Boolean.TRUE);
        version = 2;
      }
      config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.modules.ModuleConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.