Package org.olat.course.editor

Examples of org.olat.course.editor.StatusDescription


     * first check the one click cache
     */
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    boolean isValid = ENEditController.isConfigValid(getModuleConfiguration());
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions
      String shortKey = "error.nogroupdefined.short";
      String longKey = "error.nogroupdefined.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(ENEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(ENEditController.PANE_TAB_ENCONFIG);
    }
    return sd;
  }
View Full Code Here


    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)) {
          StatusDescription sd = new StatusDescription(StatusDescription.WARNING, "error.notfound.name", "solution.checkgroupmanagement",
              new String[] { "NONE", trimmed }, translatorStr);
          sd.setDescriptionForUnit(nodeId);
          missingNames.add(sd);
        }
      }
    }
    missingNames.addAll(condErrs);
View Full Code Here

                                             */
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    String file = (String) getModuleConfiguration().get(SPEditController.CONFIG_KEY_FILE);
    boolean isValid = file != null;
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions by moving the statusdescription
      // generation to the MSEditForm
      String shortKey = "error.missingfile.short";
      String longKey = "error.missingfile.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(SPEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(SPEditController.PANE_TAB_SPCONFIG);
    } else {
      // check File-type
      boolean useIframe = getModuleConfiguration().getBooleanSafe(SPEditController.CONFIG_IFRAME);
      if (!useIframe && !(file.endsWith(".html") || file.endsWith(".htm"))) {
        String shortKey = "error.wrong.filetype.short";
        String longKey = "error.wrong.filetype.long";
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(SPEditController.class);
        sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(SPEditController.PANE_TAB_SPCONFIG);

      }
    }
    return sd;

View Full Code Here

    /*
     * first check the one click cache
     */
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    StatusDescription sd = StatusDescription.NOERROR;
    boolean isValid = ScormEditController.isModuleConfigValid(getModuleConfiguration());
    if (!isValid) {
      String shortKey = "error.noreference.short";
      String longKey = "error.noreference.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(ScormEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(ScormEditController.PANE_TAB_CPCONFIG);
    }
    return sd;
  }
View Full Code Here

    String email2Areas = (String) getModuleConfiguration().get(COEditController.CONFIG_KEY_EMAILTOAREAS);
    isValid = isValid || (!"".equals(email2Areas) && email2Areas != null);
    String email2Groups = (String) getModuleConfiguration().get(COEditController.CONFIG_KEY_EMAILTOGROUPS);
    isValid = isValid || (!"".equals(email2Groups) && email2Groups != null);
    //
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      String shortKey = "error.norecipients.short";
      String longKey = "error.norecipients.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(COEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(COEditController.PANE_TAB_COCONFIG);
    }
    return sd;
  }
View Full Code Here

    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)) {
          StatusDescription sd = new StatusDescription(StatusDescription.WARNING, "error.notfound.name", "solution.checkgroupmanagement",
              new String[] { "NONE", trimmed }, translatorStr);
          sd.setDescriptionForUnit(nodeId);
          missingNames.add(sd);
        }
      }
    }
    missingNames.addAll(condErrs);
View Full Code Here

        isValid = false;
        IQEditController.removeIQReference(getModuleConfiguration());
        //FIXME:ms: may be show a refined error message, that the former referenced repo entry is meanwhile deleted.
      }
    }
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions
      String shortKey = "error.test.undefined.short";
      String longKey = "error.test.undefined.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(IQEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(IQEditController.PANE_TAB_IQCONFIG_TEST);
    }
    return sd;
  }
View Full Code Here

  public StatusDescription isConfigValid() {/*
                                             * first check the one click cache
                                             */
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    StatusDescription sd = StatusDescription.NOERROR;
    boolean isValid = CPEditController.isModuleConfigValid(getModuleConfiguration());
    if (!isValid) {
      // FIXME: refine statusdescriptions
      String shortKey = "error.noreference.short";
      String longKey = "error.noreference.long";
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(CPEditController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(CPEditController.PANE_TAB_CPCONFIG);
    }
    return sd;
  }
View Full Code Here

   * @see org.olat.course.nodes.CourseNode#isConfigValid()
   */
  public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    StatusDescription sd = StatusDescription.NOERROR;

    if(!DENEditController.isConfigValid(getModuleConfiguration())) {
      String transPackage = Util.getPackageName(DENEditController.class);
      sd = new StatusDescription(StatusDescription.WARNING, "config.nodates.short", "config.nodates.long", null, transPackage);
      sd.setDescriptionForUnit(getIdent());
      sd.setActivateableViewIdentifier(DENEditController.PANE_TAB_DENCONFIG);
    }

    return sd;
  }
View Full Code Here

    boolean isValid = true;
    Boolean hasScoring = (Boolean) getModuleConfiguration().get(CONF_SCORING_ENABLED);
    if (hasScoring.booleanValue()) {
      if (!MSEditFormController.isConfigValid(getModuleConfiguration())) isValid = false;
    }
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions by moving the statusdescription
      String shortKey = NLS_ERROR_MISSINGSCORECONFIG_SHORT;
      String longKey = NLS_ERROR_MISSINGSCORECONFIG_SHORT;
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(MSEditFormController.class);
      sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_CONF_SCORING);
    }
    // Check if any group exist make sense only with dropbox, scoring or solution
    Boolean hasDropbox  = (Boolean) getModuleConfiguration().get(CONF_DROPBOX_ENABLED);
    if (hasDropbox == null) {
      hasDropbox = new Boolean(false);
     }
    Boolean hasReturnbox = (Boolean) getModuleConfiguration().get(CONF_RETURNBOX_ENABLED);
    if(hasReturnbox == null) {
      hasReturnbox = hasDropbox;
    }
    Boolean hasSolution = (Boolean) getModuleConfiguration().get(CONF_SOLUTION_ENABLED);
    if (hasSolution == null) {
      hasSolution = new Boolean(false);
    }
   
    if (hasScoring.booleanValue() || hasDropbox.booleanValue() || hasSolution.booleanValue() || hasReturnbox.booleanValue()) {
      // check if any group exit for this course
      if ((groupMgr != null) && (groupMgr.getAllLearningGroupsFromAllContexts().size() == 0)) {
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(TaskFormController.class);
        sd = new StatusDescription(StatusDescription.WARNING, NLS_ERROR_MISSING_GROUP_SHORT, NLS_ERROR_MISSING_GROUP_LONG, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_ACCESSIBILITY);       
      } else if (hasDropbox.booleanValue() && ( conditionDrop.getEasyModeGroupAccess() == null || conditionDrop.getEasyModeGroupAccess().equals("") )
          && ( conditionDrop.getEasyModeGroupAreaAccess() == null || conditionDrop.getEasyModeGroupAreaAccess().equals("") )) {
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(TaskFormController.class);
        sd = new StatusDescription(StatusDescription.WARNING, NLS_DROPBOX_ERROR_MISSING_GROUP_SHORT, NLS_DROPBOX_ERROR_MISSING_GROUP_LONG, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_ACCESSIBILITY);         
      else if (hasReturnbox.booleanValue() && ( conditionReturnbox.getEasyModeGroupAccess() == null || conditionReturnbox.getEasyModeGroupAccess().equals("") )
          && ( conditionReturnbox.getEasyModeGroupAreaAccess() == null || conditionReturnbox.getEasyModeGroupAreaAccess().equals("") )) {
        //show NLS_RETURNBOX_ERROR_MISSING_GROUP error only if the dropCondition is also null, else use same group as for the dropbox
        if( conditionDrop.getEasyModeGroupAccess() == null /*|| conditionDrop.getEasyModeGroupAccess().equals("")*/ ) {
          String[] params = new String[] { this.getShortTitle() };
          String translPackage = Util.getPackageName(TaskFormController.class);
          sd = new StatusDescription(StatusDescription.WARNING, NLS_RETURNBOX_ERROR_MISSING_GROUP_SHORT, NLS_RETURNBOX_ERROR_MISSING_GROUP_LONG, params, translPackage);
          sd.setDescriptionForUnit(getIdent());
          // set which pane is affected by error
          sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_ACCESSIBILITY);   
        }
      } else if (hasScoring.booleanValue() && ( conditionScoring.getEasyModeGroupAccess() == null || conditionScoring.getEasyModeGroupAccess().equals("") )
          && ( conditionScoring.getEasyModeGroupAreaAccess() == null || conditionScoring.getEasyModeGroupAreaAccess().equals("") )) {
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(TaskFormController.class);
        sd = new StatusDescription(StatusDescription.WARNING, NLS_SCORING_ERROR_MISSING_GROUP_SHORT, NLS_SCORING_ERROR_MISSING_GROUP_LONG, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_ACCESSIBILITY);         
      } else if (hasSolution.booleanValue() && ( conditionSolution.getEasyModeGroupAccess() == null || conditionSolution.getEasyModeGroupAccess().equals("") )
          && ( conditionSolution.getEasyModeGroupAreaAccess() == null || conditionSolution.getEasyModeGroupAreaAccess().equals("") )) {
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(TaskFormController.class);
        sd = new StatusDescription(StatusDescription.WARNING, NLS_SOLUTION_ERROR_MISSING_GROUP_SHORT, NLS_SOLUTION_ERROR_MISSING_GROUP_LONG, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_ACCESSIBILITY);         
      }
    }
    return sd;
  }
View Full Code Here

TOP

Related Classes of org.olat.course.editor.StatusDescription

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.