'Collect archive paths and file handles that need to be exported when archiving `dataset`.
:param dataset: HistoryDatasetAssociation
:param name: archive name, in collection context corresponds to collection name(s) and element_identifier,
joined by \'/\', e.g \'fastq_collection/sample1/forward\''

def to_archive(self, trans, dataset, name=''):

    composite_extensions = trans.app.datatypes_registry.get_composite_extensions()
    composite_extensions.append('html')
    rel_paths = []
    file_paths = []
    if (dataset.extension in composite_extensions):
        main_file = ('%s.%s' % (name, 'html'))
        rel_paths.append(main_file)
        file_paths.append(dataset.file_name)
        for (fpath, rpath) in self.__archive_extra_files_path(dataset.extra_files_path):
            rel_paths.append(os.path.join(name, rpath))
            file_paths.append(fpath)
    else:
        rel_paths.append(('%s.%s' % ((name or dataset.file_name), dataset.extension)))
        file_paths.append(dataset.file_name)
    return zip(file_paths, rel_paths)
