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());