if( !(o instanceof ModelResourcesExtended) ) {
throw new SerializationException("ModelResourcesExtendedJSONSerializer is unable to serialize object of type: " + o.getClass().getName());
}
try {
ModelResourcesExtended modelResource = (ModelResourcesExtended)o;
result = new JSONObject();
Integer mrId = modelResource.getResourceId();
Resource resource = DAOFactory.getResourceDAO().loadResourceById(mrId);
result.put(RESOURCE_NAME, modelResource.getResourceName());
result.put(RESOURCE_CODE, modelResource.getResourceCode());
result.put(RESOURCE_TYPE, modelResource.getResourceType());
result.put(RESOURCE_ID, modelResource.getResourceId());
result.put(MODEL_INST_ID, modelResource.getModelInstId());
} catch (Throwable t) {
throw new SerializationException("An error occurred while serializing object: " + o, t);
} finally {