throw new SerializationException("ConfigJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
}
try {
Domain domain = null;
Config config = (Config)o;
DomainDAOHibImpl domainImpl = new DomainDAOHibImpl();
if(config.getValueTypeId() != null){
domain = domainImpl.loadDomainById(config.getValueTypeId());
}
result = new JSONObject();
result.put(CONFIG_CODE, config.getLabel()); // BIOBJ_TYPE
result.put(CONFIG_NAME, config.getName()); // BI Object types
result.put(VALUE_ID, config.getId()); // ex. 1
result.put(VALUE_CODE, config.getLabel()); // REPORT
result.put(VALUE_NAME, config.getName()); // ex. Report
result.put(VALUE_DECRIPTION, config.getDescription()); // Basic business intelligence objects type
result.put(IS_ACTIVE, config.isActive());
result.put(VALUE_CHECK, config.getValueCheck());
result.put(VALUE_TYPE, domain != null ? domain.getValueCd() : "");
result.put(CATEGORY, config.getCategory());
} catch (Throwable t) {
throw new SerializationException("An error occurred while serializing object: " + o, t);
} finally {
}