Search in sources :

Example 11 with StatusDescription

use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.

the class IQSURVCourseNode method isConfigValid.

/**
 * @see org.olat.course.nodes.CourseNode#isConfigValid()
 */
@Override
public StatusDescription isConfigValid() {
    /*
		 * first check the one click cache
		 */
    if (oneClickStatusCache != null) {
        return oneClickStatusCache[0];
    }
    boolean isValid = getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY) != null;
    if (isValid) {
        /*
			 * COnfiugre an IQxxx BB with a repo entry, do not publish this BB, mark
			 * IQxxx as deleted, remove repo entry, undelete BB IQxxx and bang you
			 * enter this if.
			 */
        Object repoEntry = IQEditController.getIQReference(getModuleConfiguration(), false);
        if (repoEntry == null) {
            isValid = false;
            IQEditController.removeIQReference(getModuleConfiguration());
        }
    }
    StatusDescription sd = StatusDescription.NOERROR;
    if (!isValid) {
        String shortKey = "error.surv.undefined.short";
        String longKey = "error.surv.undefined.long";
        String[] params = new String[] { getShortTitle() };
        sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, PACKAGE_IQ);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(IQEditController.PANE_TAB_IQCONFIG_SURV);
    }
    return sd;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription)

Example 12 with StatusDescription

use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.

the class EditScoreCalculationEasyForm method getInvalidNodeDescriptions.

/**
 * @return Returns a list with the invalid node descriptions,
 * 				("invalid" is a node that is not associated with a test resource)
 */
public List<String> getInvalidNodeDescriptions() {
    List<String> testElemWithNoResource = new ArrayList<String>();
    List<String> selectedNodesIds = new ArrayList<String>(scoreNodeIdents.getSelectedKeys());
    for (Iterator<CourseNode> nodeIter = assessableNodesList.iterator(); nodeIter.hasNext(); ) {
        CourseNode node = 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);
                }
            }
        }
    }
    return testElemWithNoResource;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription) ArrayList(java.util.ArrayList) CourseNode(org.olat.course.nodes.CourseNode)

Example 13 with StatusDescription

use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.

the class Card2BrainCourseNode method isConfigValid.

@SuppressWarnings("deprecation")
@Override
public StatusDescription isConfigValid() {
    if (oneClickStatusCache != null) {
        return oneClickStatusCache[0];
    }
    StatusDescription sd = StatusDescription.NOERROR;
    Card2BrainModule card2BrainModule = CoreSpringFactory.getImpl(Card2BrainModule.class);
    boolean isEnterpriseLogin = !getModuleConfiguration().getBooleanSafe(CONFIG_ENABLE_PRIVATE_LOGIN);
    if (!card2BrainModule.isEnterpriseLoginEnabled() && !card2BrainModule.isPrivateLoginEnabled()) {
        // both logins are deactivated
        String shortKey = "edit.warning.bothLoginDisabled.short";
        String longKey = "edit.warning.bothLoginDisabled";
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(Card2BrainEditController.class);
        sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(Card2BrainEditController.PANE_TAB_VCCONFIG);
    } else if (isEnterpriseLogin && !card2BrainModule.isEnterpriseLoginEnabled()) {
        // enterprise login is not enabled anymore
        String shortKey = "edit.warning.enterpriseLoginDisabled.short";
        String longKey = "edit.warning.enterpriseLoginDisabled";
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(Card2BrainEditController.class);
        sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(Card2BrainEditController.PANE_TAB_VCCONFIG);
    } else if (!isEnterpriseLogin && !card2BrainModule.isPrivateLoginEnabled()) {
        // private login is not enabled anymore
        String shortKey = "edit.warning.privateLoginDisabled.short";
        String longKey = "edit.warning.privateLoginDisabled";
        String[] params = new String[] { this.getShortTitle() };
        String translPackage = Util.getPackageName(Card2BrainEditController.class);
        sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
        sd.setDescriptionForUnit(getIdent());
        // set which pane is affected by error
        sd.setActivateableViewIdentifier(Card2BrainEditController.PANE_TAB_VCCONFIG);
    }
    return sd;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription) Card2BrainModule(org.olat.modules.card2brain.Card2BrainModule) Card2BrainEditController(org.olat.course.nodes.card2brain.Card2BrainEditController)

Example 14 with StatusDescription

use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.

the class BCCourseNode method isConfigValid.

/**
 * @see org.olat.course.nodes.CourseNode#isConfigValid()
 */
@Override
public StatusDescription isConfigValid() {
    updateModuleConfigDefaults(false);
    StatusDescription sd = StatusDescription.NOERROR;
    if (!getModuleConfiguration().getBooleanSafe(BCCourseNodeEditController.CONFIG_AUTO_FOLDER)) {
        String subpath = getModuleConfiguration().getStringValue(BCCourseNodeEditController.CONFIG_SUBPATH, "");
        if (!StringHelper.containsNonWhitespace(subpath)) {
            String shortKey = "error.missingfolder.short";
            String longKey = "error.missingfolder.long";
            String[] params = new String[] { this.getShortTitle() };
            String translPackage = Util.getPackageName(BCCourseNodeEditController.class);
            sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
            sd.setDescriptionForUnit(getIdent());
            // set which pane is affected by error
            sd.setActivateableViewIdentifier(BCCourseNodeEditController.PANE_TAB_FOLDER);
        }
    }
    if (oneClickStatusCache != null) {
        return oneClickStatusCache[0];
    }
    return sd;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription)

Example 15 with StatusDescription

use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.

the class BlogCourseNode method isConfigValid.

@Override
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;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription)

Aggregations

StatusDescription (org.olat.course.editor.StatusDescription)82 ArrayList (java.util.ArrayList)20 ModuleConfiguration (org.olat.modules.ModuleConfiguration)10 List (java.util.List)4 Condition (org.olat.course.condition.Condition)4 PublishProcess (org.olat.course.editor.PublishProcess)4 PublishSetInformations (org.olat.course.editor.PublishSetInformations)4 CourseNode (org.olat.course.nodes.CourseNode)4 CourseEditorTreeModel (org.olat.course.tree.CourseEditorTreeModel)4 BusinessGroupService (org.olat.group.BusinessGroupService)4 ChecklistEditController (de.bps.course.nodes.cl.ChecklistEditController)2 VCEditController (de.bps.course.nodes.vc.VCEditController)2 VCProvider (de.bps.course.nodes.vc.provider.VCProvider)2 Checklist (de.bps.olat.modules.cl.Checklist)2 Checkpoint (de.bps.olat.modules.cl.Checkpoint)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 IdentityRef (org.olat.basesecurity.IdentityRef)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2