document context manager