//loops on documents
List fieldList = sbDocs.getAttributeAsList("FIELD");
for(int i = 0; i < fieldList.size(); i++) {
SourceBean fieldSB = (SourceBean)fieldList.get(i);
SpagoBISourceBeanContainer c = new SpagoBISourceBeanContainer(fieldSB);
if( documentFields.containsKey( c.getString("id") ) ) {
JSONObject attrD = new JSONObject();
attrD.put("id", c.getString("id"));
attrD.put("visible", c.getBoolean("visible"));
attrD.put("sortable", c.getBoolean("sortable"));
attrD.put("groupable", c.getBoolean("groupable"));
if(documentSearchableFields.containsKey( c.getString("id") )) {
attrD.put("searchable", c.getBoolean("searchable"));
} else {
logger.info("field id [" + c.getString("id") + "] cannot be sorted. Configuration property will be ignored");
}
attrD.put("showLabel", c.getBoolean("showLabel"));
if(c.get("maxChars") != null) {
attrD.put("maxChars", c.getInteger("maxChars"));
}
jsonDocs.put(attrD);
} else {
logger.info("field id [" + c.getString("id") + "] is not valid. The configuration row will be ignored");
}
}