Controller for documents