diff --git a/modules/bibformat/lib/bibformat_regression_tests.py b/modules/bibformat/lib/bibformat_regression_tests.py index c5ec4ff74..b78a8d445 100644 --- a/modules/bibformat/lib/bibformat_regression_tests.py +++ b/modules/bibformat/lib/bibformat_regression_tests.py @@ -1,340 +1,341 @@ # -*- coding: utf-8 -*- ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """WebSearch module regression tests.""" __revision__ = "$Id$" import unittest from invenio.config import weburl, cdslang from invenio.testutils import make_test_suite, \ warn_user_about_tests_and_run, \ test_web_page_content from invenio.bibformat import format_record class BibFormatAPITest(unittest.TestCase): """Check BibFormat API""" def test_basic_formatting(self): """bibformat - Checking BibFormat API""" result = format_record(recID=73, of='hx', ln=cdslang, verbose=0, search_pattern=[], xml_record=None, uid=None, on_the_fly=True) pageurl = weburl + '/record/73?of=hx' result = test_web_page_content(pageurl, expected_text=result) class BibFormatBibTeXTest(unittest.TestCase): """Check output produced by BibFormat for BibTeX output for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_74_hx = '''
 @article{Wang:74,
       author       = "Wang, B and Lin, C Y and Abdalla, E",
       title        = "Quasinormal modes of Reissner-Nordstrom Anti-de Sitter
                       Black Holes",
       journal      = "Phys. Lett., B",
       number       = "hep-th/0003295",
       volume       = "481",
       pages        = "79-88",
       year         = "2000",
 }
 
''' def test_bibtex_output(self): """bibformat - BibTeX output""" pageurl = weburl + '/record/74?of=hx' result = test_web_page_content(pageurl, expected_text=self.record_74_hx) self.assertEqual([], result) class BibFormatDetailedHTMLTest(unittest.TestCase): """Check output produced by BibFormat for detailed HTML ouput for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_74_hd = '''
Published Article / Particle Physics - Theoryhep-th/0003295

Quasinormal modes of Reissner-Nordstrom Anti-de Sitter Black Holes

-Wang, B ; Lin, C Y ; Abdalla, E
+Wang, B ; Lin, C Y ; Abdalla, E

Abstract: Complex frequencies associated with quasinormal modes for large Reissner-Nordstr$\ddot{o}$m Anti-de Sitter black holes have been computed. These frequencies have close relation to the black hole charge and do not linearly scale withthe black hole temperature as in Schwarzschild Anti-de Sitter case. In terms of AdS/CFT correspondence, we found that the bigger the black hole charge is, the quicker for the approach to thermal equilibrium in the CFT. The propertiesof quasinormal modes for $l>0$ have also been studied.


Published in: Phys. Lett., B :481 2000 79-88

Fulltext : http://documents.cern.ch/cgi-bin/setlink?base=preprint&categ=hep-th&id=0003295 -

Cited by: try citation search for hep-th/0003295 +

Cited by: try citation search for hep-th/0003295

-
References:

Warning: references are automatically extracted and standardized from the PDF document and may therefore contain errors. If you think they are incorrect or incomplete, look at the fulltext document itself.

-

''' % {'weburl' : weburl} +
References:

Warning: references are automatically extracted and standardized from the PDF document and may therefore contain errors. If you think they are incorrect or incomplete, look at the fulltext document itself.

+

''' % {'weburl' : weburl, + 'lang': cdslang} self.record_7_hd = '''
Pictures / Life at CERNCERN-GE-9806033

Tim Berners-Lee
28 Jun 1998

Caption
Conference "Internet, Web, What's next?" on 26 June 1998 at CERN : Tim Berners-Lee, inventor of the World-Wide Web and Director of the W3C, explains how the Web came to be and give his views on the future.

Légende
Conference "Internet, Web, What's next?" le 26 juin 1998 au CERN: Tim Berners-Lee, inventeur du World-Wide Web et directeur du W3C, explique comment le Web est ne, et donne ses opinions sur l'avenir.

See also:
"Internet, Web, What's next?" 26 June 1998
CERN Bulletin no 28/98 (6 July 1998) (English)
CERN Bulletin no 28/98 (6 juillet 1998) (French)
Biography

Resources

High resolution: http://preprints.cern.ch/cgi-bin/setlink?base=PHO&categ=photo-ge&id=9806033


© CERN Geneva
© CERN Geneva: The use of photos requires prior authorization (from CERN copyright). The words CERN Photo must be quoted for each use.
''' def test_detailed_html_output(self): """bibformat - Detailed HTML output""" # Test record 74 (Article) pageurl = weburl + '/record/74?of=hd' result = test_web_page_content(pageurl, expected_text=self.record_74_hd) self.assertEqual([], result) # Test record 7 (Picture) pageurl = weburl + '/record/7?of=hd' result = test_web_page_content(pageurl, expected_text=self.record_7_hd) self.assertEqual([], result) class BibFormatNLMTest(unittest.TestCase): """Check output produced by BibFormat for NLM output for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_70_xn = '''
J. High Energy Phys.J. High Energy Phys.1126-6708AdS/CFT For Non-Boundary ManifoldsMcInnesB200005In its Euclidean formulation, the AdS/CFT correspondence begins as a study of Yang-Mills conformal field theories on the sphere, S^4. It has been successfully extended, however, to S^1 X S^3 and to the torus T^4. It is natural tohope that it can be made to work for any manifold on which it is possible to define a stable Yang-Mills conformal field theory. We consider a possible classification of such manifolds, and show how to deal with the most obviousobjection : the existence of manifolds which cannot be represented as boundaries. We confirm Witten's suggestion that this can be done with the help of a brane in the bulk.research-article
''' % weburl def test_nlm_output(self): """bibformat - NLM output""" pageurl = weburl + '/record/70?of=xn' result = test_web_page_content(pageurl, expected_text=self.record_70_xn) self.assertEqual([], result) class BibFormatBriefHTMLTest(unittest.TestCase): """Check output produced by BibFormat for brief HTML ouput for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_76_hb = '''Ιθάκη / Καβάφης, Κ Π
Σα βγεις στον πηγαιμό για την Ιθάκη,
να εύχεσαι νάναι μακρύς ο δρόμος,
γεμάτος περιπέτειες, γεμάτος γνώσεις. [...]
''' % weburl def test_brief_html_output(self): """bibformat - Brief HTML output""" pageurl = weburl + '/record/76?of=HB' result = test_web_page_content(pageurl, expected_text=self.record_76_hb) self.assertEqual([], result) class BibFormatMARCXMLTest(unittest.TestCase): """Check output produced by BibFormat for MARCXML ouput for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_9_xm = ''' 9 eng PRE-25553 RL-82-024 Ellis, J Grand unification with large supersymmetry breaking Mar 1982 18 p SzGeCERN General Theoretical Physics Ibanez, L E Ross, G G 1982 11 Oxford Univ. Univ. Auton. Madrid Rutherford Lab. 1990-01-28 50 2002-01-04 BATCH h 1982n PREPRINT ''' def test_marcxml_output(self): """bibformat - MARCXML output""" pageurl = weburl + '/record/9?of=xm' result = test_web_page_content(pageurl, expected_text=self.record_9_xm) self.assertEqual([], result) class BibFormatMARCTest(unittest.TestCase): """Check output produced by BibFormat for MARC ouput for various records""" def setUp(self): """Prepare some ideal outputs""" self.record_29_hm = '''000000029 001__ 29 000000029 041__ $$aeng 000000029 080__ $$a517.11 000000029 100__ $$aKleene, Stephen Cole 000000029 245__ $$aIntroduction to metamathematics 000000029 260__ $$aAmsterdam$$bNorth-Holland$$c1952 (repr.1964.) 000000029 300__ $$a560 p 000000029 490__ $$aBibl. Matematica$$v1 000000029 909C0 $$y1952 000000029 909C0 $$b21 000000029 909C1 $$c1990-01-27$$l00$$m2002-04-12$$oBATCH 000000029 909CS $$sm$$w198606 000000029 980__ $$aBOOK''' def test_marc_output(self): """bibformat - MARC output""" pageurl = weburl + '/record/29?of=hm' result = test_web_page_content(pageurl, expected_text=self.record_29_hm) self.assertEqual([], result) test_suite = make_test_suite(BibFormatBibTeXTest, BibFormatDetailedHTMLTest, BibFormatBriefHTMLTest, BibFormatNLMTest, BibFormatMARCTest, BibFormatMARCXMLTest, BibFormatAPITest) if __name__ == "__main__": warn_user_about_tests_and_run(test_suite) diff --git a/modules/bibformat/lib/elements/bfe_addresses.py b/modules/bibformat/lib/elements/bfe_addresses.py index db08ffccb..3b49516e4 100644 --- a/modules/bibformat/lib/elements/bfe_addresses.py +++ b/modules/bibformat/lib/elements/bfe_addresses.py @@ -1,59 +1,60 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints list of addresses """ __revision__ = "$Id$" import cgi from urllib import quote from invenio.config import weburl def format(bfo, separator="; ", print_link="yes"): """ Prints a list of addresses linked to this report @param separator the separator between addresses. @param print_link Links the addresses to search engine (HTML links) if 'yes' """ addresses = bfo.fields('270') list_addresses = [] if print_link.lower() == 'yes': for address in addresses: list_addresses.append(''+cgi.escape(address.get('p', "")) \ - +'') + quote(address.get('p', "")) + \ + '&ln=' + bfo.lang + \ + '">'+cgi.escape(address.get('p', "")) + \ + '') list_addresses.append(cgi.escape(address.get('g', ""))) else: for address in addresses: list_addresses.append(cgi.escape(address.get('p', ""))) list_addresses.append(cgi.escape(address.get('g', ""))) return separator.join(list_addresses) def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_authors.py b/modules/bibformat/lib/elements/bfe_authors.py index abc49afc6..06543e309 100644 --- a/modules/bibformat/lib/elements/bfe_authors.py +++ b/modules/bibformat/lib/elements/bfe_authors.py @@ -1,138 +1,139 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints authors """ __revision__ = "$Id$" def format(bfo, limit, separator=' ; ', extension='[...]', print_links="yes", print_affiliations='no', affiliation_prefix = ' (', affiliation_suffix = ')', interactive="no", highlight="no"): """ Prints the list of authors of a record. @param limit the maximum number of authors to display @param separator the separator between authors. @param extension a text printed if more authors than 'limit' exist @param print_links if yes, prints the authors as HTML link to their publications @param print_affiliations if yes, make each author name followed by its affiliation @param affiliation_prefix prefix printed before each affiliation @param affiliation_suffix suffix printed after each affiliation @param interactive if yes, enable user to show/hide authors when there are too many (html + javascript) @param highlight highlights authors corresponding to search query if set to 'yes' """ from urllib import quote from cgi import escape from invenio.config import weburl from invenio.messages import gettext_set_language _ = gettext_set_language(bfo.lang) # load the right message language authors = [] authors_1 = bfo.fields('100__') authors_2 = bfo.fields('700__') authors.extend(authors_1) authors.extend(authors_2) nb_authors = len(authors) # Process authors to add link, highlight and format affiliation for author in authors: if author.has_key('a'): if highlight == 'yes': from invenio import bibformat_utils author['a'] = bibformat_utils.highlight(author['a'], bfo.search_pattern) if print_links.lower() == "yes": author['a'] = ''+escape(author['a'])+'' if author.has_key('u'): if print_affiliations == "yes": author['u'] = affiliation_prefix + author['u'] + \ affiliation_suffix # Flatten author instances if print_affiliations == 'yes': authors = [author.get('a', '') + author.get('u', '') for author in authors] else: authors = [author.get('a', '') for author in authors] if limit.isdigit() and nb_authors > int(limit) and interactive != "yes": return separator.join(authors[:int(limit)]) + extension elif limit.isdigit() and nb_authors > int(limit) and interactive == "yes": out = ''' '''%{'show_less':_("Hide"), 'show_more':_("Show all %i authors") % nb_authors, 'extension':extension} out += '' out += separator.join(authors[:int(limit)]) out += '' + separator + \ separator.join(authors[int(limit):]) + '' out += ' ' out += ' ' out += '' return out elif nb_authors > 0: return separator.join(authors) def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_cited_by.py b/modules/bibformat/lib/elements/bfe_cited_by.py index 1ffa923a2..7226274a7 100644 --- a/modules/bibformat/lib/elements/bfe_cited_by.py +++ b/modules/bibformat/lib/elements/bfe_cited_by.py @@ -1,59 +1,61 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints reference to documents citing this one """ __revision__ = "$Id$" import cgi def format(bfo, separator='; '): """ Prints a list of records citing this record @param separator a separator between citations """ from urllib import quote from invenio.config import weburl primary_report_numbers = bfo.fields('037__a') additional_report_numbers = bfo.fields('088__a') primary_citations = ['' \ - + cgi.escape(x) + '' \ - for x in primary_report_numbers] + '/search?f=reference&p=' + quote(report_number) + \ + '&ln='+ bfo.lang +'">' + \ + cgi.escape(report_number) + '' \ + for report_number in primary_report_numbers] additional_citations = ['' \ - + cgi.escape(x) + '' \ - for x in additional_report_numbers] + '/search?f=reference&p=' + quote(report_number)+ \ + '&ln='+ bfo.lang + '">' + \ + cgi.escape(report_number) + '' \ + for report_number in additional_report_numbers] citations = primary_citations citations.extend(additional_citations) return separator.join(citations) def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_contact.py b/modules/bibformat/lib/elements/bfe_contact.py index 034f9e810..440109071 100644 --- a/modules/bibformat/lib/elements/bfe_contact.py +++ b/modules/bibformat/lib/elements/bfe_contact.py @@ -1,43 +1,46 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints contact information """ __revision__ = "$Id$" def format(bfo, separator='; ', link="yes"): """ Prints contact information for the record @param separator the separator between addresses. @param link Link the addresses to search engine (HTML links) if 'yes' """ from urllib import quote from invenio.config import weburl addresses = bfo.fields('270__p') - addresses = map(lambda x: ''+x+'', addresses) - + if link == "yes": + addresses = ['' + \ + address +'' for address in addresses] + return separator.join(addresses) diff --git a/modules/bibformat/lib/elements/bfe_edit_record.py b/modules/bibformat/lib/elements/bfe_edit_record.py index bde22c7fa..d1c36a891 100644 --- a/modules/bibformat/lib/elements/bfe_edit_record.py +++ b/modules/bibformat/lib/elements/bfe_edit_record.py @@ -1,53 +1,57 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints a link to BibEdit """ __revision__ = "$Id$" def format(bfo, style): """ Prints a link to BibEdit, if authorization is granted @param style the CSS style to be applied to the link. """ from invenio.config import weburl from invenio.access_control_engine import acc_authorize_action out = "" uid = bfo.uid if uid is not None: (auth_code, auth_message) = acc_authorize_action(uid,'runbibedit') if auth_code == 0: print_style = '' if style != '': print_style = 'style="' + style + '"' - out += 'Edit This Record' + out += 'Edit This Record' return out def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_editors.py b/modules/bibformat/lib/elements/bfe_editors.py index 57f0d18d8..8b23f1ca2 100644 --- a/modules/bibformat/lib/elements/bfe_editors.py +++ b/modules/bibformat/lib/elements/bfe_editors.py @@ -1,49 +1,54 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints editors """ __revision__ = "$Id$" def format(bfo, limit, separator=' ; ', extension='[...]', print_links="yes"): """ Prints the list of editors of a record. @param limit the maximum number of editors to display @param separator the separator between editors. @param extension a text printed if more editors than 'limit' exist @param print_links if yes, print the editors as HTML link to their publications """ from urllib import quote from invenio.config import weburl from invenio import bibrecord authors = bibrecord.record_get_field_instances(bfo.get_record(), '100') - editors = [bibrecord.field_get_subfield_values(author, 'a')[0] for author in authors if len(bibrecord.field_get_subfield_values(author, "e")) > 0 and bibrecord.field_get_subfield_values(author, "e")[0]=="ed." ] + editors = [bibrecord.field_get_subfield_values(author, 'a')[0] + for author in authors if len(bibrecord.field_get_subfield_values(author, "e")) > 0 and bibrecord.field_get_subfield_values(author, "e")[0]=="ed." ] if print_links.lower() == "yes": - editors = map(lambda x: ''+x+'', editors) + editors = ['' + editor + '' + for editor in editors] if limit.isdigit() and len(editors) > int(limit): return separator.join(editors[:int(limit)]) + extension elif len(editors) > 0: return separator.join(editors) diff --git a/modules/bibformat/lib/elements/bfe_keywords.py b/modules/bibformat/lib/elements/bfe_keywords.py index ebb2981f2..72a073afe 100644 --- a/modules/bibformat/lib/elements/bfe_keywords.py +++ b/modules/bibformat/lib/elements/bfe_keywords.py @@ -1,59 +1,61 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints keywords """ __revision__ = "$Id$" import cgi from urllib import quote from invenio.config import weburl def format(bfo, keyword_prefix, keyword_suffix, separator=' ; ', link='yes'): """ Display keywords of the record. @param keyword_prefix a prefix before each keyword @param keyword_suffix a suffix after each keyword @param separator a separator between keywords @param link links the keywords if 'yes' (HTML links) """ keywords = bfo.fields('6531_a') if len(keywords) > 0: if link == 'yes': keywords = ['' + cgi.escape(keyword) + '' + quote(keyword) + \ + '&ln='+ bfo.lang+ \ + '">' + cgi.escape(keyword) + '' for keyword in keywords] else: keywords = [cgi.escape(keyword) for keyword in keywords] keywords = [keyword_prefix + keyword + keyword_suffix for keyword in keywords] return separator.join(keywords) def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_references.py b/modules/bibformat/lib/elements/bfe_references.py index b1d08d948..e7780e406 100644 --- a/modules/bibformat/lib/elements/bfe_references.py +++ b/modules/bibformat/lib/elements/bfe_references.py @@ -1,70 +1,78 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints references """ __revision__ = "$Id$" def format(bfo, reference_prefix, reference_suffix): """ Prints the references of this record @param reference_prefix a prefix displayed before each reference @param reference_suffix a suffix displayed after each reference """ from invenio.config import weburl references = bfo.fields("999C5") out = "" for reference in references: if reference_prefix is not None: out += reference_prefix if reference.has_key('o'): out += "
  • "+ reference['o']+ " " if reference.has_key('m'): out += ""+ reference['m']+ " " if reference.has_key('r'): - out += ' ['+ reference['r']+ "]
    " + out += ' ['+ reference['r']+ "]
    " if reference.has_key('t'): ejournal = bfo.kb("ejournals", reference.get('t', "")) if ejournal != "": out += ' ' - out += reference['t']+": "+reference.get('v', "")+" ("+reference.get('y', "")+") " + +"&volume="+reference.get('v', "")+"&year="+\ + reference.get('y', "")+"&page="+\ + reference.get('p',"").split("-")[0]+'">' + out += reference['t']+": "+reference.get('v', "")+\ + " ("+reference.get('y', "")+") " out += reference.get('p', "")+"
    " else: - out += " "+reference['t']+ reference.get('v', "")+ reference.get('y',"")+ reference.get('p',"")+ "
    " + out += " "+reference['t']+ reference.get('v', "")+\ + reference.get('y',"")+ reference.get('p',"")+ \ + "
    " if reference_suffix is not None: out += reference_suffix return out def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0 diff --git a/modules/bibformat/lib/elements/bfe_url.py b/modules/bibformat/lib/elements/bfe_url.py index cc7430a4a..ca3431ceb 100644 --- a/modules/bibformat/lib/elements/bfe_url.py +++ b/modules/bibformat/lib/elements/bfe_url.py @@ -1,44 +1,46 @@ # -*- coding: utf-8 -*- ## ## $Id$ ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN. ## ## CDS Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## CDS Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """BibFormat element - Prints full-text URLs """ __revision__ = "$Id$" def format(bfo, style, separator='; '): """ This is the default format for formatting full-text URLs. @param separator the separator between urls. @param style CSS class of the link """ urls_u = bfo.fields("8564_u") if style != "": style = 'class="'+style+'"' - urls = map(lambda x: ''+x+'', urls_u) + urls = ['' + url +'' + for url in urls_u] return separator.join(urls) def escape_values(bfo): """ Called by BibFormat in order to check if output of this element should be escaped. """ return 0