For the filling, drain the soaked whole wheat (if using) and place in a pan with the milk and lemon zest. Simmer for 3-4 hours over a low heat.
When the grain is tender, add the ground cinnamon, vanilla sugar and orange zest. Remove from the heat, cool, cover and place in the fridge until the next day.
For the pastry, place the sugar, butter and eggs into a bowl and beat until smooth. Add the flour and stir to make a smooth pastry. Set aside in a cool place for at least one hour.
Preheat the oven to 190C/375F/Gas 5.
To continue making the filling, if you have soaked the whole wheat (according to the instructions above), remove it from the fridge. If you are using the canned cooked wheat, add it to the lemon zest, cinnamon, vanilla sugar and orange zest.
Beat the ricotta in a large mixing bowl with the egg yolks and the orange flower water. Add the candied peel pieces and the flavoured grain to the ricotta mixture.
Beat the egg whites in a separate bowl with the sugar until light and fluffy. Fold them gently into the ricotta using a large metal spoon.
Butter a large flan tin 35cm/14in in diameter.
Roll two-thirds of the pastry out into a circle that will cover the base of the tin, as well as the sides. Press this pastry into the flan tin, covering the bottom and sides with an equal thickness.
Pour the ricotta mixture into the pastry case. Roll out the remaining pastry, cut into long strips and use these to make a lattice top for the tart.
Bake in the oven for about 45 minutes.
Allow to cool and dust with icing sugar. Serve in slices.