Package org.olat.course.editor

Examples of org.olat.course.editor.StatusDescription


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


  }

  public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    StatusDescription sd = StatusDescription.NOERROR;
    String transPackage = ChecklistEditController.class.getPackage().getName();
   
    // no configuration available hence there is no checklist with checkpoints
    if(getModuleConfiguration().get(ChecklistCourseNode.CONF_CHECKLIST) == null) {
      sd = new StatusDescription(ValidationStatus.ERROR, "config.nocheckpoints.short", "config.nocheckpoints.long", null, transPackage);
      sd.setDescriptionForUnit(getIdent());
      sd.setActivateableViewIdentifier(ChecklistEditController.PANE_TAB_CLCONFIG);
      return sd;
    }
   
    Checklist checklist = (Checklist) getModuleConfiguration().get(ChecklistCourseNode.CONF_CHECKLIST);
    // checklist without any checkpoints makes no sense
    if (!checklist.hasCheckpoints()) {
      sd = new StatusDescription(ValidationStatus.ERROR, "config.nocheckpoints.short", "config.nocheckpoints.long", null, transPackage);
      sd.setDescriptionForUnit(getIdent());
      sd.setActivateableViewIdentifier(ChecklistEditController.PANE_TAB_CLCONFIG);
      return sd;
    }
   
    // information, if all checkpoints are invisible
    boolean allUnvisible = true;
    boolean noLearners = false;
    if (checklist.hasCheckpoints()) {
      List<Checkpoint> checkpoints = ((Checklist)getModuleConfiguration().get(ChecklistCourseNode.CONF_CHECKLIST)).getCheckpoints();
      for (Checkpoint checkpoint : checkpoints) {
        if (!checkpoint.getMode().equals(CheckpointMode.MODE_HIDDEN)) allUnvisible = false;
      }
      if(allUnvisible) {
        Condition cond = getPreConditionVisibility();
        if(cond.isEasyModeCoachesAndAdmins()) noLearners = true;
        if(!noLearners) {
          sd = new StatusDescription(ValidationStatus.WARNING, "config.allhidden.short", "config.allhidden.long", null, transPackage);
          sd.setDescriptionForUnit(getIdent());
          sd.setActivateableViewIdentifier(ChecklistEditController.PANE_TAB_CLCONFIG);
        }
      }
    }
    return sd;
  }
View Full Code Here

   * {@inheritDoc}
   */
  public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) { return oneClickStatusCache[0]; }

    StatusDescription sd = StatusDescription.NOERROR;

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

    return sd;
  }
View Full Code Here

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

    String host = (String) getModuleConfiguration().get(TUConfigForm.CONFIGKEY_HOST);
    boolean isValid = host != null;
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions
      String[] params = new String[] { this.getShortTitle() };
      String translPackage = Util.getPackageName(TUConfigForm.class);
      sd = new StatusDescription(StatusDescription.ERROR, NLS_ERROR_HOSTMISSING_SHORT, NLS_ERROR_HOSTMISSING_LONG, params, translPackage);
      sd.setDescriptionForUnit(getIdent());
      // set which pane is affected by error
      sd.setActivateableViewIdentifier(TUEditController.PANE_TAB_TUCONFIG);
    }
    return sd;
  }
View Full Code Here

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

    boolean isValid = MSEditFormController.isConfigValid(getModuleConfiguration());
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
      // FIXME: refine statusdescriptions by moving the statusdescription
      // generation to the MSEditForm
      String shortKey = "error.missingconfig.short";
      String longKey = "error.missingconfig.long";
      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(MSCourseNodeEditController.PANE_TAB_CONFIGURATION);
    }
    return sd;
  }
View Full Code Here

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

    StatusDescription status = StatusDescription.NOERROR;
    boolean invalid = config.get(CONFIG_KEY_REPOSITORY_SOFTKEY) == null;
    if (invalid) {
      String[] params = new String[] { this.getShortTitle() };
      String shortKey = "error.no.reference.short";
      String longKey = "error.no.reference.long";
      String translationPackage = Util.getPackageName(PodcastNodeEditController.class);
      status = new StatusDescription(ValidationStatus.ERROR, shortKey, longKey, params, translationPackage);
      status.setDescriptionForUnit(getIdent());
      // Set which pane is affected by error
      status.setActivateableViewIdentifier(FeedNodeEditController.PANE_TAB_FEED);
    }
    return status;
  }
View Full Code Here

    List<String> testElemWithNoResource = new ArrayList<String>();
    List<String> selectedNodesIds = new ArrayList<String>(scoreNodeIdents.getSelectedKeys());   
    for (Iterator nodeIter = assessableNodesList.iterator(); nodeIter.hasNext();) {
      CourseNode node = (CourseNode) nodeIter.next();
      if (selectedNodesIds.contains(node.getIdent())) {       
        StatusDescription isConfigValid = node.isConfigValid();
        if (isConfigValid != null && isConfigValid.isError()) {
          String nodeDescription = node.getShortName() + " (Id:" + node.getIdent() + ")";
          if (!testElemWithNoResource.contains(nodeDescription)) {
            testElemWithNoResource.add(nodeDescription);
          }
        }
View Full Code Here

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

    StatusDescription status = StatusDescription.NOERROR;
    boolean invalid = config.get(CONFIG_KEY_REPOSITORY_SOFTKEY) == null;
    if (invalid) {
      String[] params = new String[] { this.getShortTitle() };
      String shortKey = "error.no.reference.short";
      String longKey = "error.no.reference.long";
      String translationPackage = Util.getPackageName(BlogNodeEditController.class);
      status = new StatusDescription(ValidationStatus.ERROR, shortKey, longKey, params, translationPackage);
      status.setDescriptionForUnit(getIdent());
      // Set which pane is affected by error
      status.setActivateableViewIdentifier(FeedNodeEditController.PANE_TAB_FEED);
    }
    return status;
  }
View Full Code Here

    if (ce != null) {
      Set<String> selectedNodesIds = ce.getSoftReferencesOf("courseNodeId");
      for (Iterator nodeIter = assessableNodesList.iterator(); nodeIter.hasNext();) {
        CourseNode node = (CourseNode) nodeIter.next();
        if (selectedNodesIds.contains(node.getIdent())) {
          StatusDescription isConfigValid = node.isConfigValid();
          if (isConfigValid != null && isConfigValid.isError()) {
            String nodeDescription = node.getShortName() + " (Id:" + node.getIdent() + ")";
            if (!nodeDescriptionList.contains(nodeDescription)) {
              nodeDescriptionList.add(nodeDescription);
            }
          }
View Full Code Here

        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.surv.undefined.short";
      String longKey = "error.surv.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_SURV);
    }
    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.