The factory YJ tops will fit onto the body of your CJ7, but they are designed for half doors and your doors won't fit unless you buy a set of half doors from a YJ (which will also fit the CJ7).
I don't think they made factory YJ tops that work with full doors, but I could be wrong. I've never seen one though.
A better solution would be an aftermarket top for a CJ7 or a YJ that works with hard doors or full soft doors like a Supertop or something similar.