def load_tag_code_from_name(name): """ Uses BibFormat DB layer API to load a tag code (035__a) from its name (ext system ID). Raises an exception if name does not exist. """ tag = get_tag_from_name(name) if not tag: raise BibCatalogTagNotFound("Tag not found for %s" % (name,)) return tag
def load_tag_code_from_name(name): """ Uses BibFormat DB layer API to load a tag code (035__a) from its name (ext system ID). Raises an exception if name does not exist. """ tag = get_tag_from_name(name) if not tag: raise BibCatalogTagNotFound("Tag not found for %s" % (name, )) return tag
## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. from invenio.bibformat_dblayer import get_tag_from_name from invenio.errorlib import raise_exception def alert_admin(name): raise_exception(ValueError, 'No marc tag for %s defined' % name, alert_admin=True) # abstract: marc_tag_abstract = get_tag_from_name('abstract') if marc_tag_abstract: CFG_MARC_ABSTRACT = marc_tag_abstract else: CFG_MARC_ABSTRACT = '520__a' alert_admin('abstract') # author name: marc_tag_author = get_tag_from_name('first author name') if marc_tag_author: CFG_MARC_AUTHOR_NAME = marc_tag_author else: CFG_MARC_AUTHOR_NAME = '100__a' alert_admin('first author name') # additional author name:
import re import tempfile import time import os from os.path import exists, join from invenio.bibrecord import record_xml_output, record_add_field from invenio.bibformat_dblayer import get_tag_from_name from invenio.search_engine import search_pattern, get_fieldvalues from invenio.config import CFG_TMPDIR from invenio.bibtask import task_low_level_submission from invenio.websubmit_config import InvenioWebSubmitFunctionError CFG_OTHER_RELATIONSHIP_ENTRY = (get_tag_from_name('other relationship entry') or '787')[:3] CFG_PRIMARY_REPORTNUMBER = get_tag_from_name('primary report number') or '037__a' RE_FILENAME = re.compile("\\<pa\\>file\\:(.+)\\<\\/pa\\>", re.I) def Link_Records(parameters, curdir, form, user_info=None): """ This function create a MARC link between two records (the 1st specified in the edsrn file or SN, the second specified by edsrn2 file, where you can store the reportnumber or directly the recid. In "directRelationship" you should specify either the name of a file (by using <pa>file:filename</pa>) or direclty, what is the relationship of the second record to be stored in the metadata of the 1st record. In the file "reverseRelationship" you can similarly specify the other direction of the harrow. """ global sysno
#Maximal time to keep the stored XML Service doucment before reloading it in sec CFG_BIBSWORD_SERVICEDOCUMENT_UPDATE_TIME = 3600 #Default submission status CFG_SUBMISSION_STATUS_SUBMITTED = "submitted" CFG_SUBMISSION_STATUS_PUBLISHED = "published" CFG_SUBMISSION_STATUS_ONHOLD = "onhold" CFG_SUBMISSION_STATUS_REMOVED = "removed" CFG_SUBMIT_ARXIV_INFO_MESSAGE = "Submitted from Invenio to arXiv by %s, on %s, as %s" CFG_DOCTYPE_UPLOAD_COLLECTION = 'PUSHED_TO_ARXIV' # report number: marc_tag_main_report_number = get_tag_from_name('primary report number') if marc_tag_main_report_number: CFG_MARC_REPORT_NUMBER = marc_tag_main_report_number else: CFG_MARC_REPORT_NUMBER = '037__a' # title: marc_tag_title = get_tag_from_name('title') if marc_tag_title: CFG_MARC_TITLE = marc_tag_title else: CFG_MARC_TITLE = '245__a' # author name: marc_tag_author = get_tag_from_name('first author name') if marc_tag_author:
## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. from invenio.bibformat_dblayer import get_tag_from_name from invenio.errorlib import raise_exception def alert_admin(name): raise_exception(ValueError, 'No marc tag for %s defined' % name, alert_admin=True) # abstract: marc_tag_abstract = get_tag_from_name('abstract') if marc_tag_abstract: CFG_MARC_ABSTRACT = marc_tag_abstract else: CFG_MARC_ABSTRACT = '520__a' alert_admin('abstract') # author name: marc_tag_author = get_tag_from_name('first author name') if marc_tag_author: CFG_MARC_AUTHOR_NAME = marc_tag_author else: CFG_MARC_AUTHOR_NAME = '100__a' alert_admin('first author name')
#Default user agent for invenio sword-client CFG_DEFAULT_USER_AGENT = 'Invenio SWORD client' #Default submission status CFG_SUBMISSION_STATUS_SUBMITTED = "submitted" CFG_SUBMISSION_STATUS_PUBLISHED = "published" CFG_SUBMISSION_STATUS_ONHOLD = "onhold" CFG_SUBMISSION_STATUS_REMOVED = "removed" CFG_SUBMIT_ARXIV_INFO_MESSAGE = "Submitted from Invenio to arXiv by %s, on %s, as %s" CFG_DOCTYPE_UPLOAD_COLLECTION = 'PUSHED_TO_ARXIV' # report number: marc_tag_main_report_number = get_tag_from_name('primary report number') if marc_tag_main_report_number: CFG_MARC_REPORT_NUMBER = marc_tag_main_report_number else: CFG_MARC_REPORT_NUMBER = '037__a' # title: marc_tag_title = get_tag_from_name('title') if marc_tag_title: CFG_MARC_TITLE = marc_tag_title else: CFG_MARC_TITLE = '245__a' # author name: marc_tag_author = get_tag_from_name('first author name') if marc_tag_author:
CFG_WEBAUTHORPROFILE_ALLOWED_FIELDCODES, \ CFG_WEBSEARCH_DEF_RECORDS_IN_GROUPS, \ CFG_SITE_NAME, CFG_INSPIRE_SITE, \ CFG_WEBSEARCH_DEFAULT_SEARCH_INTERFACE, \ CFG_BIBINDEX_CHARS_PUNCTUATION, \ CFG_WEBSEARCH_WILDCARD_LIMIT # maximum number of collaborating authors etc shown in GUI from invenio.config import CFG_WEBAUTHORPROFILE_MAX_COLLAB_LIST, \ CFG_WEBAUTHORPROFILE_MAX_KEYWORD_LIST, CFG_WEBAUTHORPROFILE_MAX_FIELDCODE_LIST, \ CFG_WEBAUTHORPROFILE_MAX_AFF_LIST, CFG_WEBAUTHORPROFILE_MAX_COAUTHOR_LIST, \ CFG_WEBAUTHORPROFILE_ORCID_ENDPOINT_PUBLIC, CFG_WEBAUTHORPROFILE_ORCID_ENDPOINT_MEMBER # controlled keyword: marc_tag_control_keyword = get_tag_from_name('controlled keyword') if marc_tag_control_keyword: CFG_WEBAUTHORPROFILE_KEYWORD_TAG = marc_tag_control_keyword else: CFG_WEBAUTHORPROFILE_KEYWORD_TAG = '695__a' # subject: marc_tag_subject = get_tag_from_name('subject') if marc_tag_subject: CFG_WEBAUTHORPROFILE_FIELDCODE_TAG = marc_tag_subject else: CFG_WEBAUTHORPROFILE_FIELDCODE_TAG = '65017a' # uncontrolled keyword: marc_tag_uncontrol_keyword = get_tag_from_name('uncontrolled keyword') if marc_tag_uncontrol_keyword:
CFG_WEBAUTHORPROFILE_CACHE_EXPIRED_DELAY_LIVE, \ CFG_WEBAUTHORPROFILE_USE_ALLOWED_FIELDCODES, \ CFG_WEBAUTHORPROFILE_ALLOWED_FIELDCODES, \ CFG_WEBSEARCH_DEF_RECORDS_IN_GROUPS, \ CFG_SITE_NAME, CFG_INSPIRE_SITE, \ CFG_WEBSEARCH_DEFAULT_SEARCH_INTERFACE, \ CFG_BIBINDEX_CHARS_PUNCTUATION, \ CFG_WEBSEARCH_WILDCARD_LIMIT # maximum number of collaborating authors etc shown in GUI from invenio.config import CFG_WEBAUTHORPROFILE_MAX_COLLAB_LIST, \ CFG_WEBAUTHORPROFILE_MAX_KEYWORD_LIST, CFG_WEBAUTHORPROFILE_MAX_FIELDCODE_LIST, \ CFG_WEBAUTHORPROFILE_MAX_AFF_LIST, CFG_WEBAUTHORPROFILE_MAX_COAUTHOR_LIST # controlled keyword: marc_tag_control_keyword = get_tag_from_name('controlled keyword') if marc_tag_control_keyword: CFG_WEBAUTHORPROFILE_KEYWORD_TAG = marc_tag_control_keyword else: CFG_WEBAUTHORPROFILE_KEYWORD_TAG = '695__a' # subject: marc_tag_subject = get_tag_from_name('subject') if marc_tag_subject: CFG_WEBAUTHORPROFILE_FIELDCODE_TAG = marc_tag_subject else: CFG_WEBAUTHORPROFILE_FIELDCODE_TAG = '65017a' # uncontrolled keyword: marc_tag_uncontrol_keyword = get_tag_from_name('uncontrolled keyword') if marc_tag_uncontrol_keyword: