'Adds a custom method for a resource or component
@param prefix: prefix of the resource name (=module name)
@param name: name of the resource (=without prefix)
@param component_name: name of the component
@param method: name of the method
@param action: function to invoke for this method'

@classmethod
def set_method(cls, prefix, name, component_name=None, method=None, action=None):

    methods = current.model.methods
    cmethods = current.model.cmethods
    if (not method):
        raise SyntaxError('No    method    specified')
    tablename = ('%s_%s' % (prefix, name))
    if (not component_name):
        if (method not in methods):
            methods[method] = {}
        methods[method][tablename] = action
    else:
        if (method not in cmethods):
            cmethods[method] = {}
        if (component_name not in cmethods[method]):
            cmethods[method][component_name] = {}
        cmethods[method][component_name][tablename] = action
