Base controller for documents