Package org.olat.course.editor

Examples of org.olat.course.editor.StatusDescription


        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) {
      String shortKey = "error.self.undefined.short";
      String longKey = "error.self.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_SELF);
    }
    return sd;
  }
View Full Code Here


    return retVal;
  }

  static class ErrorsGtWarningGtInfo implements Comparator<StatusDescription> {
    public int compare(StatusDescription o1, StatusDescription o2) {
      StatusDescription s1 = o1;
      StatusDescription s2 = o2;
      return s2.getLevel().intValue() - s1.getLevel().intValue();
    }
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
// TODO:cg 28.01.2010 no assessment-tool in V1.0     
//      sd.setActivateableViewIdentifier(ProjectBrokerCourseEditorController.PANE_TAB_CONF_SCORING);
    }
    return sd;
View Full Code Here

   */
  @SuppressWarnings("static-access")//for StatusDescription.WARNING
  protected List<StatusDescription> isConfigValidWithTranslator(CourseEditorEnv cev, String translatorStr, List<ConditionExpression> condExprs) {
    List<StatusDescription> condExprsStatusDescs = new ArrayList<StatusDescription>();
    // check valid configuration without course environment
    StatusDescription first = isConfigValid();
    // check valid configuration within the course environment
    if (cev == null) {
      // course environment not configured!??
      condExprsStatusDescs.add(first);
      return condExprsStatusDescs;
    }
    /*
     * there is course editor environment, we can check further. Iterate over
     * all conditions of this course node, validate the condition expression and
     * transform the condition error message into a status description
     */
    for (int i = 0; i < condExprs.size(); i++) {
      ConditionExpression ce = condExprs.get(i);
      ConditionErrorMessage[] cems = cev.validateConditionExpression(ce);
      if (cems != null && cems.length > 0) {
        for (int j = 0; j < cems.length; j++) {
          StatusDescription sd = new StatusDescription(StatusDescription.WARNING, cems[j].errorKey, cems[j].solutionMsgKey,
              cems[j].errorKeyParams, translatorStr);
          sd.setDescriptionForUnit(getIdent());
          condExprsStatusDescs.add(sd);
        }
      }
    }
    condExprsStatusDescs.add(first);
View Full Code Here

  /**
   * @see org.olat.course.nodes.CourseNode#explainThisDuringPublish(org.olat.core.gui.control.StatusDescription)
   */
  public StatusDescription explainThisDuringPublish(StatusDescription description) {
    if (description == null) return null;
    StatusDescription retVal = null;
    if (description.getShortDescriptionKey().equals("error.notfound.coursenodeid")) {
      retVal = description.transformTo("error.notfound.coursenodeid.publish", "error.notfound.coursenodeid.publish", null);
    } else if (description.getShortDescriptionKey().equals("error.notfound.name")) {
      retVal = description.transformTo("error.notfound.name.publish", "error.notfound.name.publish", null);
    } else if (description.getShortDescriptionKey().equals("error.notassessable.coursenodid")) {
View Full Code Here

   * @see org.olat.core.gui.components.tree.TreeNode#getIconDecorator2CssClass()
   */
  public String getIconDecorator2CssClass() {
    //top-right
   
    StatusDescription sd = cn.isConfigValid();
    //this one is deleted
    if (deleted) return "o_middel";
    //errors!
    if (sd.isError()) return "o_miderr";
    //ready for publish
    if (!sd.isError() && dirty) return "o_midpub";
    //instead of >>if(hasPublishableChanges()) return "o_midpub";<< because
    return null;
  }
View Full Code Here

   */
  public String getIconDecorator3CssClass() {
    //do not show errors if marked for deletion
    if(deleted) return null;
    //
    StatusDescription sd = cn.isConfigValid();
    //warnings only
    if (sd.isWarning()) return "o_midwarn";
    return null;
  }
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.