Examples of ModuleConfiguration


Examples of org.olat.modules.ModuleConfiguration

        logInfo("deleting publisher with key; "+publisher.getKey(), null);
        //NotificationsManager.getInstance().delete(publisher);
        // return nothing available
        return null;
      }
      ModuleConfiguration config = ((WikiCourseNode)courseNode).getModuleConfiguration();
      RepositoryEntry re = WikiEditController.getWikiRepoReference(config, true);
      resId = re.getOlatResource().getResourceableId();
      businessPath = "[RepositoryEntry:" + re.getKey().toString() + "]"
        + "[CourseNode:" + publisher.getSubidentifier() + "]";
    } else {
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

   * @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) {
      // use defaults for new course building blocks
      config.setBooleanEntry(STCourseNodeEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue());
      // set the default display to peekview in two columns
      config.setStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW);
      config.setIntValue(STCourseNodeEditController.CONFIG_KEY_COLUMNS, 2);
      config.setConfigurationVersion(3);
    } else {
      // update to version 2
      if (config.getConfigurationVersion() < 2) {
        // use values accoring to previous functionality
        config.setBooleanEntry(STCourseNodeEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue());
        // previous version of score st node didn't have easy mode on score
        // calculator, se to expert mode
        if (getScoreCalculator() != null) {
          getScoreCalculator().setExpertMode(true);
        }
        config.setConfigurationVersion(2);
      }
      // update to version 3
      if (config.getConfigurationVersion() < 3) {
        String fileName = (String) config.get(STCourseNodeEditController.CONFIG_KEY_FILE);
        if (fileName != null) {
          // set to custom file display config
          config.setStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_FILE);
        } else {
          // set the default display to plain vanilla TOC view in one column
          config.setStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_TOC);
          config.setIntValue(STCourseNodeEditController.CONFIG_KEY_COLUMNS, 1);
        }
        config.setConfigurationVersion(3);
      }
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  @Override
  public String getDisplayOption() {
    // if nothing other defined, view content only, when a structure node
    // contains an html-file.
    OLog logger = Tracing.createLoggerFor(this.getClass());
    ModuleConfiguration config = getModuleConfiguration();
    String thisConf = super.getDisplayOption(false);
    if (thisConf == null
        && config.get(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE).equals(STCourseNodeEditController.CONFIG_VALUE_DISPLAY_FILE)) {
      if (logger.isDebug()) {
        logger.debug("no displayOption set, use default (content)", thisConf);
      }
      return CourseNode.DISPLAY_OPTS_CONTENT;
    }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

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

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#hasDetails()
   */
  public boolean hasDetails() {
    ModuleConfiguration modConfig = getModuleConfiguration();
    Boolean hasTask = (Boolean) modConfig.get(TACourseNode.CONF_TASK_ENABLED);
    if (hasTask == null) hasTask = Boolean.FALSE;
    Boolean hasDropbox = (Boolean) modConfig.get(TACourseNode.CONF_DROPBOX_ENABLED);
    if (hasDropbox == null) hasDropbox = Boolean.FALSE;   
    Boolean hasReturnbox = (Boolean) modConfig.get(TACourseNode.CONF_RETURNBOX_ENABLED);
    if (hasReturnbox == null) hasReturnbox = hasDropbox;
   
    return (hasTask.booleanValue() || hasDropbox.booleanValue() || hasReturnbox.booleanValue());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.