use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class STCourseNode 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];
}
ModuleConfiguration config = getModuleConfiguration();
StatusDescription sd = StatusDescription.NOERROR;
if (STCourseNodeEditController.CONFIG_VALUE_DISPLAY_FILE.equals(config.getStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE))) {
String fileName = (String) config.get(STCourseNodeEditController.CONFIG_KEY_FILE);
if (fileName == null || !StringHelper.containsNonWhitespace(fileName)) {
String shortKey = "error.missingfile.short";
String longKey = "error.missingfile.long";
String[] params = new String[] { this.getShortTitle() };
String translPackage = Util.getPackageName(SPEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(STCourseNodeEditController.PANE_TAB_ST_CONFIG);
}
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class PFCourseNode method isConfigValid.
@Override
public StatusDescription isConfigValid() {
StatusDescription sd = StatusDescription.NOERROR;
boolean isValid = hasCoachBoxConfigured() || hasParticipantBoxConfigured();
if (!isValid) {
String shortKey = "error.noreference.short";
String longKey = "error.noreference.long";
String[] params = new String[] { this.getShortTitle() };
@SuppressWarnings("deprecation") String translPackage = Util.getPackageName(PFEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(CONFIG_KEY_PARTICIPANTBOX);
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class ProjectBrokerCourseNode 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 = true;
Boolean hasScoring = (Boolean) getModuleConfiguration().get(CONF_SCORING_ENABLED);
if (hasScoring.booleanValue()) {
if (!MSEditFormController.isConfigValid(getModuleConfiguration()))
isValid = false;
}
StatusDescription sd = StatusDescription.NOERROR;
if (!isValid) {
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
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class TUCourseNode method isConfigValid.
/**
* @see org.olat.course.nodes.CourseNode#isConfigValid()
*/
public StatusDescription isConfigValid() {
/*
* first check the one click cache
*/
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;
}
use of org.olat.course.editor.StatusDescription in project OpenOLAT by OpenOLAT.
the class VideoCourseNode method isConfigValid.
@Override
public StatusDescription isConfigValid() {
if (oneClickStatusCache != null) {
return oneClickStatusCache[0];
}
StatusDescription sd = StatusDescription.NOERROR;
boolean isValid = VideoEditController.isModuleConfigValid(getModuleConfiguration());
if (!isValid) {
// FIXME: refine statusdescriptions
String shortKey = "no.video.chosen";
String longKey = "error.noreference.long";
String[] params = new String[] { this.getShortTitle() };
String translPackage = Util.getPackageName(VideoEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(VideoEditController.PANE_TAB_VIDEOCONFIG);
}
return sd;
}
Aggregations