Heat oven to 350°F.
Heat 1 tablespoon extra-virgin olive oil in a saucepan over medium-high heat, add the shallots and garlic, and sauté for 1 minute. Add the tomatoes and season with salt and pepper.
Reduce heat to medium low and cook the tomatoes until all the liquid has evaporated, but the tomatoes are still slightly chunky.
While the tomatoes are cooking, heat the remaining tablespoon of oil in a large frying pan over high heat. Season both sides of the cod with salt and freshly ground black pepper, and sear each side for about 2 minutes, or until nicely browned. When the fillets are seared, place them on a baking sheet. Put cod in the oven to finish cooking. (According to Chef Ripert, an easy test for doneness is to insert a metal skewer into the center of a fillet for 5 seconds. The fish is done when the skewer goes in easily and, when removed, feels slightly warm to your lip.).
Place 1/2 cup of the beans in a food processor with the reserved bean-cooking liquid and purée until smooth to make the sauce. Season to taste with salt and pepper.
To serve, spoon tomato compote in the center of each plate and place a cod fillet on top. Spoon bean sauce outside the compote, and sprinkle reserved whole cooked beans around the fish and over the two sauces. Drizzle with tiny drops of truffle oil.