'Entry point for REST interface.
@param r: the S3Request instance
@param attr: controller attributes
@note: always returns PDF, disregarding the requested format'

def apply_method(self, r, **attr):

    output = {}
    if (r.http == 'GET'):
        if r.id:
            tablename = r.tablename
            if (tablename == 'req_req'):
                output = self.request_form(r, **attr)
            elif (tablename == 'inv_send'):
                output = self.waybill(r, **attr)
            elif (tablename == 'inv_recv'):
                output = self.goods_received_note(r, **attr)
            else:
                r.error(405, current.ERROR.BAD_METHOD)
        else:
            r.error(400, current.ERROR.BAD_REQUEST)
    else:
        r.error(405, current.ERROR.BAD_METHOD)
    return output
