Package org.olat.modules

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 || config.getConfigurationVersion() < 2) {
      // use defaults for new course building blocks
      config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.FALSE.booleanValue());
      config.setConfigurationVersion(2);
    }
    // else node is up-to-date - nothing to do
    config.remove(NodeEditController.CONFIG_INTEGRATION);
  }
View Full Code Here


    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

    super(TYPE);
    initDefaultConfig();
  }

  private void initDefaultConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    // add an empty checkpoint entry as default if none existent
    if (config.get(CONF_CHECKLIST) == null) {
      Checklist initialChecklist = new Checklist();
      // set to config
      config.set(CONF_CHECKLIST, initialChecklist);
      // save to db
      ChecklistManager.getInstance().saveChecklist(initialChecklist);
    }
  }
View Full Code Here

    super(TYPE);
    initDefaultConfig();
  }

  private void initDefaultConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    // add an empty link entry as default if none existent
    if (config.get(CONF_LINKLIST) == null) {
      List<LLModel> initialList = new ArrayList<LLModel>(1);
      initialList.add(new LLModel());
      config.set(CONF_LINKLIST, initialList);
    }
  }
View Full Code Here

  IQDisplayController(Resolver resolver, String type, IQSecurityCallback secCallback, UserRequest ureq, WindowControl wControl) {
    super(wControl);

    ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LEARNING_RESOURCE_OPEN, getClass());

    this.modConfig = new ModuleConfiguration();
    modConfig.set(IQEditController.CONFIG_KEY_ENABLEMENU, Boolean.TRUE);
    modConfig.set(IQEditController.CONFIG_KEY_TYPE, type);
    modConfig.set(IQEditController.CONFIG_KEY_SEQUENCE, AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM);
    modConfig.set(IQEditController.CONFIG_KEY_SCOREPROGRESS, Boolean.TRUE);
    modConfig.set(IQEditController.CONFIG_KEY_QUESTIONPROGRESS, Boolean.FALSE);
View Full Code Here

            // Best we can do here -> return noSubsInfo and clean up
            NotificationsManager.getInstance().deactivate(p);
            // return nothing available
            return NotificationsManager.getInstance().getNoSubscriptionInfo();
          }
          ModuleConfiguration config = ((WikiCourseNode)courseNode).getModuleConfiguration();
          RepositoryEntry re = WikiEditController.getWikiRepoReference(config, true);
          resId = re.getOlatResource().getResourceableId();
          logDebug("resId=" + resId, null);
          ores = OresHelper.createOLATResourceableInstance(WikiResource.TYPE_NAME, resId);
          businessControlString = p.getBusinessPath() + "[path=";
View Full Code Here

        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

   * @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

  @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

  /**
   * @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

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.