Making a cuztomized viewer for newly registered file types

I registered a new file type .dwg. Added a fileaction “Open” to the fileactions menu of the Files application, so “Open” would be shown only for dwg files.
The goals are:

  1. To open a viewer window like the one for text files on clicking the “Open” fileaction.
  2. The content part of the viewer window should be customized. So I’d like to make my own content part.
    Could someone help and explain how to achieve these goals?