'Get all existing links for record_id.
@param resource: the resource the record belongs to
@param record_id: the record ID
@return: list of component record IDs this record is
linked to via the link table'

def extract(self, resource, record_id):

    self.resource = resource
    (component, link) = self.get_link()
    from s3rest import S3Request
    r = S3Request(resource.prefix, resource.name, args=[], get_vars={})
    customise_resource = current.deployment_settings.customise_resource
    for tablename in (component.tablename, link.tablename):
        customise = customise_resource(tablename)
        if customise:
            customise(r, tablename)
    self.initialized = True
    if record_id:
        rkey = component.rkey
        rows = link.select([rkey], as_rows=True)
        if rows:
            rkey = str(link.table[rkey])
            values = [row[rkey] for row in rows]
        else:
            values = []
    else:
        values = [link.table[self.options.field].default]
    return values
