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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations