DcModule result = DcModules.convert(module);
DcModules.register(result);
DcModules.registerPropertyModules(result);
Settings settings = result.getSettings();
DcFieldDefinitions definitions = (DcFieldDefinitions) settings.getDefinitions(DcRepository.ModuleSettings.stFieldDefinitions);
DcFieldDefinition definition;
for (XmlField field : module.getFields()) {
definition = definitions.get(field.getIndex());
if (field.getDefinition() != null) {
definition.setEnabled(true);
definition.setTab(field.getDefinition().getTab());
definition.setUnique(field.getDefinition().isUnique());
definition.setDescriptive(field.getDefinition().isDescriptive());
definition.setRequired(field.getDefinition().isRequired());
definition.setLabel("");
}
}
settings.set(DcRepository.ModuleSettings.stEnabled, Boolean.TRUE);
settings.save();
close();
} catch (Exception e) {
throw new WizardException(DcResources.getText("msgCouldNotWriteModuleFile", e.getMessage()));
}