* @param isNewNode true: an initial configuration is set; false: upgrading
* from previous node configuration version, set default to maintain
* previous behaviour
*/
public void updateModuleConfigDefaults(boolean isNewNode) {
ModuleConfiguration config = getModuleConfiguration();
if (isNewNode) {
// use defaults for new course building blocks
config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, false);
config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, false);
// new since config version 3
config.setBooleanEntry(SPEditController.CONFIG_IFRAME, Boolean.TRUE.booleanValue());
config.set(SPEditController.CONFIG_KEY_STATEFUL, Boolean.FALSE.toString());
config.setConfigurationVersion(3);
} else {
config.remove(NodeEditController.CONFIG_INTEGRATION);
int version = config.getConfigurationVersion();
if (version < 2) {
// use values accoring to previous functionality
config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.FALSE.booleanValue());
config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue());
config.setConfigurationVersion(2);
}
if (version < 3) {
config.setBooleanEntry(SPEditController.CONFIG_IFRAME, Boolean.TRUE.booleanValue());
config.set(SPEditController.CONFIG_KEY_STATEFUL, Boolean.FALSE.toString());
config.setConfigurationVersion(3);
}
}
}