} else {
subObjectsList = DAOFactory.getSubObjectDAO().getAccessibleSubObjects(biobjectId, userProfile);
}
} catch (EMFUserError e) {
logger.error("Error while recovering subobjects list for document with id = " + biobjectId, e);
throw new SpagoBIServiceException(SERVICE_NAME, "Cannot load customized views", e);
} catch (EMFInternalError e) {
logger.error("Error while recovering information about user", e);
throw new SpagoBIServiceException(SERVICE_NAME, "Error while recovering information about user", e);
}
try {
JSONArray subObjectsListJSON = (JSONArray) SerializerFactory.getSerializer("application/json").serialize( subObjectsList,null );
JSONObject results = new JSONObject();
results.put("results", subObjectsListJSON);
writeBackToClient( new JSONSuccess( results ) );
} catch (IOException e) {
throw new SpagoBIServiceException(SERVICE_NAME, "Impossible to write back the responce to the client", e);
} catch (SerializationException e) {
throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects", e);
} catch (JSONException e) {
throw new SpagoBIServiceException(SERVICE_NAME, "Cannot serialize objects into a JSON object", e);
}
} finally {
logger.debug("OUT");
}