Search in sources :

Example 1 with Card2BrainModule

use of org.olat.modules.card2brain.Card2BrainModule 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;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription) Card2BrainModule(org.olat.modules.card2brain.Card2BrainModule) Card2BrainEditController(org.olat.course.nodes.card2brain.Card2BrainEditController)

Example 2 with Card2BrainModule

use of org.olat.modules.card2brain.Card2BrainModule in project openolat by klemens.

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;
}
Also used : StatusDescription(org.olat.course.editor.StatusDescription) Card2BrainModule(org.olat.modules.card2brain.Card2BrainModule) Card2BrainEditController(org.olat.course.nodes.card2brain.Card2BrainEditController)

Aggregations

StatusDescription (org.olat.course.editor.StatusDescription)2 Card2BrainEditController (org.olat.course.nodes.card2brain.Card2BrainEditController)2 Card2BrainModule (org.olat.modules.card2brain.Card2BrainModule)2