Beispiel #1
0
def tab_list(bibcode, list_type):

    #I get the document
    solrdoc = get_document(bibcode)

    #if there are no references I return a 404
    if not solrdoc or not solrdoc.has_assoc_list(list_type):
        abort(404)

    #I get the additional metadata
    inveniodoc = invenio.get_invenio_metadata(bibcode)

    #I parse the get options 
    query_components = QueryBuilderSimple.build(request.values, list_type=list_type)

    # use the appropriate getter method
    list_method = getattr(solrdoc, "get_%s" % list_type)
    if not list_method:
        abort(404)

    #I get the list of associated docs
    resp = list_method(**query_components)
    
    # log the request
    abstract_view_signal.send(abs_blueprint, bibcode=bibcode, type=list_type)
    
    return render_template('abstract_tabs.html', solrdoc=solrdoc, inveniodoc=inveniodoc, curview=list_type, article_list=resp)
Beispiel #2
0
def tab_list(bibcode, list_type):

    solrdoc = get_document(bibcode)

    # if there are no references return a 404
    if not solrdoc or not solrdoc.has_assoc_list(list_type):
        abort(404)

    denormdoc = denormalize_solr_doc(solrdoc)

    # parse the get options
    query_components = QueryBuilderSimple.build(request.values, list_type=list_type)

    # use the appropriate getter method
    list_method = getattr(solrdoc, "get_%s" % list_type)
    if not list_method:
        abort(404)

    # get the list of associated docs
    resp = list_method(**query_components)

    # log the request
    abstract_view_signal.send(abs_blueprint, bibcode=bibcode, list_type=list_type)
    statsd.incr("abs.%s.viewed" % list_type)

    return render_template(
        "abstract_tabs.html", solrdoc=solrdoc, denormdoc=denormdoc, curview=list_type, article_list=resp
    )
Beispiel #3
0
def abstract(bibcode):
    
    solrdoc = get_document(bibcode)
    if not solrdoc:
        abort(404)
    inveniodoc = invenio.get_invenio_metadata(bibcode)
    
    # log the request
    abstract_view_signal.send(abs_blueprint, bibcode=bibcode, type="abstract")
    
    return render_template('abstract_tabs.html', solrdoc=solrdoc, inveniodoc=inveniodoc, curview='abstract')
Beispiel #4
0
def abstract(bibcode=None):

    if bibcode is None:
        abort(404)

    solrdoc = get_document(bibcode)
    if not solrdoc:
        abort(404)
    denormdoc = denormalize_solr_doc(solrdoc)

    # log the request
    abstract_view_signal.send(abs_blueprint, bibcode=bibcode, list_type="abstract")
    statsd.incr("abs.abstract.viewed")

    return render_template("abstract_tabs.html", solrdoc=solrdoc, denormdoc=denormdoc, curview="abstract")
Beispiel #5
0
def abstract(bibcode=None):
    
    if bibcode is None:
        abort(404)
        
    solrdoc = get_document(bibcode)
    if not solrdoc:
        abort(404)
    denormdoc = denormalize_solr_doc(solrdoc)

    # get article graphics info
    graphics = get_thumbnails(bibcode)
    # log the request
    abstract_view_signal.send(abs_blueprint, bibcode=bibcode, list_type="abstract")
    statsd.incr("abs.abstract.viewed")
    
    return render_template('abstract_tabs.html', solrdoc=solrdoc, denormdoc=denormdoc, graphics=graphics, curview='abstract')