use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class ENCourseNode method addStatusErrorMissing.
private StatusDescription addStatusErrorMissing(List<String> missingObjects) {
String labelKey = missingObjects.size() == 1 ? "error.notfound.name" : "error.notfound.names";
StringBuilder missing = new StringBuilder();
for (String missingObject : missingObjects) {
if (missing.length() > 0)
missing.append(", ");
missing.append(missingObject);
}
StatusDescription sd = new StatusDescription(StatusDescription.WARNING, labelKey, "solution.checkgroupmanagement", new String[] { "NONE", missing.toString() }, PACKAGE_COND);
sd.setDescriptionForUnit(getIdent());
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class ENCourseNode method isConfigValid.
/**
* @see org.olat.course.nodes.CourseNode#isConfigValid()
*/
public StatusDescription isConfigValid() {
/*
* 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[] { 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;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class IQSELFCourseNode 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());
// 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[] { 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_SELF);
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class IQTESTCourseNode 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.test.undefined.short";
String longKey = "error.test.undefined.long";
String[] params = new String[] { getShortTitle() };
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translatorStr);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(IQEditController.PANE_TAB_IQCONFIG_TEST);
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNode method isConfigValid.
@Override
public StatusDescription isConfigValid() {
if (oneClickStatusCache != null) {
return oneClickStatusCache[0];
}
StatusDescription sd = StatusDescription.NOERROR;
boolean isValid = PortfolioCourseNodeEditController.isModuleConfigValid(getModuleConfiguration());
if (!isValid) {
String shortKey = "error.noreference.short";
String longKey = "error.noreference.long";
String[] params = new String[] { getShortTitle() };
sd = new StatusDescription(ValidationStatus.ERROR, shortKey, longKey, params, PACKAGE_EP);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(PortfolioCourseNodeEditController.PANE_TAB_CONFIG);
}
return sd;
}
Aggregations