'PRECONDITION: security checks on ability to add to parent occurred
during load.'

def copy(self, trans, parent, source, encoded_source_id):

    assert (source == 'hdca')
    source_hdca = self.__get_history_collection_instance(trans, encoded_source_id)
    new_hdca = source_hdca.copy()
    tags_str = self.tag_manager.get_tags_str(source_hdca.tags)
    self.tag_manager.apply_item_tags(trans.get_user(), new_hdca, tags_str)
    parent.add_dataset_collection(new_hdca)
    trans.sa_session.add(new_hdca)
    trans.sa_session.flush()
    return new_hdca
