'Extract the items from the resource
@param resource: the resource
@param list_fields: fields to include in list views'

def extractResource(self, resource, list_fields):

    title = self.crud_string(resource.tablename, 'title_list')
    get_vars = Storage(current.request.get_vars)
    get_vars['iColumns'] = len(list_fields)
    (query, orderby, left) = resource.datatable_filter(list_fields, get_vars)
    resource.add_filter(query)
    data = resource.select(list_fields, left=left, limit=None, orderby=orderby, represent=True, show_links=False)
    rfields = data['rfields']
    types = []
    colnames = []
    heading = {}
    for rfield in rfields:
        if rfield.show:
            colnames.append(rfield.colname)
            heading[rfield.colname] = rfield.label
            if rfield.virtual:
                types.append('string')
            else:
                types.append(rfield.ftype)
    items = data['rows']
    return (title, types, colnames, heading, items)
