Examples of ModuleConfiguration


Examples of org.olat.modules.ModuleConfiguration

    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(COEditController.CONFIG_KEY_EMAILTOAREAS);
    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(COEditController.CONFIG_KEY_EMAILTOGROUPS);
    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

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  public Float getCutValueConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_CUTVALUE);
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
   */
  public Float getMaxScoreConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_MAXSCORE);
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
   */
  public Float getMinScoreConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_MINSCORE);
  }
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) {
      // 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_ASSESS);
      config.set(IQEditController.CONFIG_KEY_SUMMARY, AssessmentInstance.QMD_ENTRY_SUMMARY_COMPACT);
      config.set(IQEditController.CONFIG_KEY_ENABLESCOREINFO, new Boolean(true));
    } else {
      int version = config.getConfigurationVersion();
      if (version < CURRENT_CONFIG_VERSION) {
        // Loaded config is older than current config version => migrate
        if (version == 1) {
          // migrate V1 => V2, new parameter 'enableScoreInfo'
          version = 2;
          config.set(IQEditController.CONFIG_KEY_ENABLESCOREINFO, new Boolean(true));
        }
        config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
      }
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

      fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
     
    } else if (source == nodeDisplayConfigFormController) {
      if (event == Event.DONE_EVENT) {
        // update the module configuration
        ModuleConfiguration moduleConfig = stNode.getModuleConfiguration();
        nodeDisplayConfigFormController.updateModuleConfiguration(moduleConfig);
        allowRelativeLinks = moduleConfig.getBooleanEntry(CONFIG_KEY_ALLOW_RELATIVE_LINKS);
        // update some class vars
        if (CONFIG_VALUE_DISPLAY_FILE.equals(moduleConfig.getStringValue(CONFIG_KEY_DISPLAY_TYPE))) {
          editorEnabled = true;
          configvc.contextPut("editorEnabled", Boolean.valueOf(editorEnabled));
          stNode.getModuleConfiguration().set(CONFIG_KEY_FILE, chosenFile);
          addStartEditorToView(ureq);
        } else { // user generated overview
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(NodeEditController.CONFIG_STARTPAGE, Boolean.FALSE.booleanValue());
      config.setBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU, Boolean.TRUE.booleanValue());
      config.setConfigurationVersion(2);
    } else {
      config.remove(NodeEditController.CONFIG_INTEGRATION);
      if (config.getConfigurationVersion() < 2) {
        // update new configuration options using default values for existing
        // nodes
        config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.TRUE.booleanValue());
        Boolean componentMenu = config.getBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU);
        if (componentMenu == null) {
          config.setBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU, Boolean.TRUE.booleanValue());
        }
        config.setConfigurationVersion(2);
      }
      // else node is up-to-date - nothing to do
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

    super(TYPE);
    updateModuleConfigDefaults(true);
  }

  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
      // use defaults for new course building blocks
      config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, false);
      config.setConfigurationVersion(1);
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

    addLoggingResourceable(LoggingResourceable.wrap(stCourseNode));

    myContent = createVelocityContainer("run");
   
    // read display configuration
    ModuleConfiguration config = stCourseNode.getModuleConfiguration();
    // configure number of display rows
    int rows = config.getIntegerSafe(STCourseNodeEditController.CONFIG_KEY_COLUMNS, 1);
    myContent.contextPut("layoutType", (rows == 1 ? "o_course_run_toc_one_column" : "o_course_run_toc_two_columns"));
    // the display type: toc or peekview
    String displayType = config.getStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW);

    // Build list of child nodes and peek views if necessary
    List<CourseNode> children = new ArrayList<CourseNode>();

    // Build up a overview of all visible children (direct children only, no
    // grandchildren)
    String peekviewChildNodesConfig = config.getStringValue(STCourseNodeEditController.CONFIG_KEY_PEEKVIEW_CHILD_NODES, null);
    List<String> peekviewChildNodes =  (peekviewChildNodesConfig == null ? new ArrayList<String>() : Arrays.asList(peekviewChildNodesConfig.split(",")));
    int chdCnt = ne.getChildCount();
    for (int i = 0; i < chdCnt; i++) {
      NodeEvaluation neChd = ne.getNodeEvaluationChildAt(i);
      if (neChd.isVisible()) {
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

    }
  }
 
  @Override
  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if(config.getConfigurationVersion() < 2) {
      List<LLModel> links = (List<LLModel>)config.get(CONF_LINKLIST);
      for(LLModel link:links) {
        String linkValue = link.getTarget();
        if(!linkValue.contains("://")) {
          linkValue = "http://".concat(linkValue.trim());
        }
        if(linkValue.startsWith(Settings.getServerContextPathURI())) {
          link.setHtmlTarget("_self");
        } else {
          link.setHtmlTarget("_blank");
        }
      }
      config.setConfigurationVersion(2);
    }
  }
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.