Refactor to use common method to get document id

Call clearArchiveFlag() when saving documents.