//hashmap to use during
HashMap< String, Integer> attributesLookup = new HashMap< String, Integer> ();
for (int i=0; i<defaultAttributes.size();i++) {
SourceBean attribute = (SourceBean) defaultAttributes.get(i);
SbiAttribute sbiAttribute = new SbiAttribute();
String attrName = (String) attribute.getAttribute("name");
SbiAttribute existingAttribute = attrDAO.loadSbiAttributeByName(attrName);
if(existingAttribute == null){
sbiAttribute.setAttributeName(attrName);
String attrDescr = (String) attribute.getAttribute("description");
sbiAttribute.setDescription(attrDescr);
try {
Integer id = attrDAO.saveSbiAttribute(sbiAttribute);
attributesLookup.put(attrName, id);
} catch (EMFUserError e) {
logger.error(e.getMessage(), e);
}
}else{
attributesLookup.put(attrName, existingAttribute.getAttributeId());
}
}
List defaultRoles = _config.getAttributeAsList("DEFAULT_ROLES.ROLE");