use of org.olat.course.editor.StatusDescription in project openolat by klemens.
the class SPCourseNode 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 file = (String) getModuleConfiguration().get(SPEditController.CONFIG_KEY_FILE);
boolean isValid = file != null;
StatusDescription sd = StatusDescription.NOERROR;
if (!isValid) {
// FIXME: refine statusdescriptions by moving the statusdescription
// generation to the MSEditForm
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(SPEditController.PANE_TAB_SPCONFIG);
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project openolat by klemens.
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 klemens.
the class OpenMeetingsCourseNode method isConfigValid.
@Override
public StatusDescription isConfigValid() {
if (oneClickStatusCache != null) {
return oneClickStatusCache[0];
}
StatusDescription sd = StatusDescription.NOERROR;
if (groupMgr != null) {
OpenMeetingsManager openMeetingsManager = CoreSpringFactory.getImpl(OpenMeetingsManager.class);
Long roomId = openMeetingsManager.getRoomId(null, groupMgr.getCourseResource(), getIdent());
if (roomId == null) {
String shortKey = "error.noroom.short";
String longKey = "error.noroom.long";
String[] params = new String[] { getShortTitle() };
String translPackage = Util.getPackageName(OpenMeetingsRoomEditController.class);
sd = new StatusDescription(StatusDescription.ERROR, shortKey, longKey, params, translPackage);
sd.setDescriptionForUnit(getIdent());
// set which pane is affected by error
sd.setActivateableViewIdentifier(CPEditController.PANE_TAB_CPCONFIG);
}
}
return sd;
}
use of org.olat.course.editor.StatusDescription in project openolat by klemens.
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;
}
use of org.olat.course.editor.StatusDescription in project openolat by klemens.
the class GTACourseNode method addStatusErrorDescription.
private void addStatusErrorDescription(String key, String pane, List<StatusDescription> status) {
String[] params = new String[] { getShortTitle() };
StatusDescription sd = new StatusDescription(StatusDescription.ERROR, key, key, params, PACKAGE_GTA);
sd.setDescriptionForUnit(getIdent());
sd.setActivateableViewIdentifier(pane);
status.add(sd);
}
Aggregations