'Resource structure introspection method (single table)
@param r: the S3Request instance
@param attr: controller attributes'

@staticmethod
def get_fields(r, **attr):

    representation = r.representation
    if (representation == 'xml'):
        output = r.resource.export_fields(component=r.component_name)
        content_type = 'text/xml'
    elif (representation == 's3json'):
        output = r.resource.export_fields(component=r.component_name, as_json=True)
        content_type = 'application/json'
    else:
        r.error(415, current.ERROR.BAD_FORMAT)
    response = current.response
    response.headers['Content-Type'] = content_type
    return output
