Пример #1
0
    def sendtrackback(self, req, form):
        """
        Send a new trackback
        """
        if CFG_WEBLINKBACK_TRACKBACK_ENABLED:
            argd = wash_urlargd(
                form, {
                    'url':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                    'title':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                    'excerpt':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                    'blog_name':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                    'id':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                    'source':
                    (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                })

            perform_sendtrackback(req, self.recid, argd['url'], argd['title'],
                                  argd['excerpt'], argd['blog_name'],
                                  argd['id'], argd['source'], argd['ln'])
        else:
            perform_sendtrackback_disabled(req)
Пример #2
0
    def sendtrackback(self, req, form):
        """
        Send a new trackback
        """
        if CFG_WEBLINKBACK_TRACKBACK_ENABLED:
            argd = wash_urlargd(form, {'url': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       'title': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       'excerpt': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       'blog_name': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       'id': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       'source': (str, CFG_WEBLINKBACK_SUBSCRIPTION_DEFAULT_ARGUMENT_NAME),
                                       })

            perform_sendtrackback(req, self.recid, argd['url'], argd['title'], argd['excerpt'], argd['blog_name'], argd['id'], argd['source'], argd['ln'])
        else:
            perform_sendtrackback_disabled(req)
Пример #3
0
def sendtrackback(recid, url, title, excerpt, blog_name, id, source):
    from invenio.legacy.weblinkback.api import perform_sendtrackback, perform_sendtrackback_disabled
    mime_type = 'text/xml; charset=utf-8'
    if CFG_WEBLINKBACK_TRACKBACK_ENABLED:
        xml_response, status = perform_sendtrackback(recid, url, title, excerpt, blog_name, id, source, current_user)
    else:
        xml_response, status = perform_sendtrackback_disabled()
    return Response(response=xml_response, status=status, mimetype=mime_type)
Пример #4
0
def sendtrackback(recid, url, title, excerpt, blog_name, id, source):
    from invenio.legacy.weblinkback.api import (perform_sendtrackback,
                                                perform_sendtrackback_disabled)
    mime_type = 'text/xml; charset=utf-8'
    if CFG_WEBLINKBACK_TRACKBACK_ENABLED:
        xml_response, status = perform_sendtrackback(recid, url, title,
                                                     excerpt, blog_name, id,
                                                     source, current_user)
    else:
        xml_response, status = perform_sendtrackback_disabled()
    return Response(response=xml_response, status=status, mimetype=mime_type)