use of org.olat.course.editor.StatusDescription in project openolat by klemens.
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 klemens.
the class TACourseNode 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 = true;
Boolean hasScoring = (Boolean) getModuleConfiguration().get(CONF_SCORING_ENABLED);
if (hasScoring.booleanValue()) {
if (!MSEditFormController.isConfigValid(getModuleConfiguration()))
isValid = false;
}
StatusDescription sd = StatusDescription.NOERROR;
if (!isValid) {
// FIXME: refine statusdescriptions by moving the statusdescription
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
sd.setActivateableViewIdentifier(TACourseNodeEditController.PANE_TAB_CONF_SCORING);
}
// Check if any group exist make sense only with dropbox, scoring or solution
Boolean hasDropbox = (Boolean) getModuleConfiguration().get(CONF_DROPBOX_ENABLED);
if (hasDropbox == null) {
hasDropbox = new Boolean(false);
}
Boolean hasReturnbox = (Boolean) getModuleConfiguration().get(CONF_RETURNBOX_ENABLED);
if (hasReturnbox == null) {
hasReturnbox = hasDropbox;
}
Boolean hasSolution = (Boolean) getModuleConfiguration().get(CONF_SOLUTION_ENABLED);
if (hasSolution == null) {
hasSolution = new Boolean(false);
}
// remove the error handling for missing groups as you can use the course members
return sd;
}
use of org.olat.course.editor.StatusDescription in project openolat by klemens.
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;
}
use of org.olat.course.editor.StatusDescription in project openolat by klemens.
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 klemens.
the class PodcastCourseNode 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(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;
}
Aggregations