Collective and boson mapping description of a system of N Josephson junctions in a resonant cavity