'This will take a s3_import_upload record and
generate the importJob
@param uploadFilename: The name of the uploaded file
@todo: complete parameter descriptions'

def _generate_import_job(self, upload_id, openFile, fileFormat, stylesheet=None, commit_job=False):

    if (fileFormat in ('csv', 'comma-separated-values')):
        fmt = 'csv'
        src = openFile
    elif (fileFormat in ('xls', 'xlsx', 'xlsm')):
        fmt = 'xls'
        src = openFile
    else:
        msg = (self.messages.unsupported_file_type % fileFormat)
        self.error = msg
        current.log.debug(msg)
        return None
    if (stylesheet == None):
        stylesheet = self._get_stylesheet()
    if (stylesheet == None):
        return None
    request = self.request
    resource = request.resource
    self.table = self.controller_table
    self.tablename = self.controller_tablename
    args = Storage()
    mode = request.get_vars.get('xsltmode', None)
    if (mode is not None):
        args.update(mode=mode)
    resource.import_xml(src, format=fmt, extra_data=self.csv_extra_data, stylesheet=stylesheet, ignore_errors=True, commit_job=commit_job, **args)
    job = resource.job
    if (job is None):
        if resource.error:
            self.error = resource.error
            return None
        else:
            self.warning = self.messages.no_records_to_import
            return None
    else:
        db = current.db
        job_id = job.job_id
        errors = current.xml.collect_errors(job)
        if errors:
            current.response.s3.error_report = errors
        query = (self.upload_table.id == upload_id)
        result = db(query).update(job_id=job_id)
        db.commit()
    self.job_id = job_id
    return True
