// save new, well-formed SyncopeConf and associated CSchema, CAttr and CAttrValue
for (Map.Entry<String, String> entry : syncopeConf.entrySet()) {
final String key = entry.getKey();
final String value = entry.getValue();
// 1. create CSChema
CSchema confSchema = new CSchema();
confSchema.setName(key);
confSchema.setType(AttributeSchemaType.String);
confSchema.setMultivalue(value.contains("|"));
confSchema.setUniqueConstraint(false);
confSchema.setReadonly(false);
confSchema = schemaDAO.save(confSchema);
// 2. create and save CAttr
final CAttr confAttr = new CAttr();
confAttr.setSchema(confSchema);
confAttr.setOwner(confDAO.get());
if (confSchema.isMultivalue()) {
for (String singleValue : value.split("|")) {
confAttr.addValue(singleValue, AttributableUtil.getInstance(AttributableType.CONFIGURATION));
}
} else {
confAttr.addValue(value, AttributableUtil.getInstance(AttributableType.CONFIGURATION));