コード例 #1
0
ファイル: bridge_config.py プロジェクト: mhellmic/b2share
from invenio.ext.logging import register_exception
from invenio.modules.ranker.registry import configuration


CFG_BIBRANK_WRD_CFG_PATH = configuration.get('wrd.cfg', '')


def alert_admin(name):
    try:
        raise ValueError('No marc tag for %s defined' % name)
    except Exception:
        return register_exception(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')
コード例 #2
0
ファイル: Link_Records.py プロジェクト: chokribr/invenio-1
from os.path import exists, join

from invenio.legacy.bibrecord import \
     record_xml_output, \
     record_add_field, \
     record_add_fields, \
     record_get_field_instances, \
     create_record
from invenio.modules.formatter import format_record
from invenio.modules.formatter.api import get_tag_from_name
from invenio.legacy.search_engine import search_pattern, get_fieldvalues
from invenio.config import CFG_TMPDIR
from invenio.legacy.bibsched.bibtask import task_low_level_submission, bibtask_allocate_sequenceid
from invenio.legacy.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.

    Parameters:

     * edsrn: the file containing the report number or recid of the
コード例 #3
0
ファイル: bridge_config.py プロジェクト: chokribr/invenio-1
from invenio.modules.formatter.api import get_tag_from_name
from invenio.ext.logging import register_exception
from invenio.modules.ranker.registry import configuration

CFG_BIBRANK_WRD_CFG_PATH = configuration.get('wrd.cfg', '')


def alert_admin(name):
    try:
        raise ValueError('No marc tag for %s defined' % name)
    except Exception:
        return register_exception(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:
コード例 #4
0
ファイル: config.py プロジェクト: pombredanne/invenio-3
from invenio.modules.formatter.api import get_tag_from_name

#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:
コード例 #5
0
ファイル: Link_Records.py プロジェクト: mhellmic/b2share
import re
import tempfile
import time
import os

from os.path import exists, join

from invenio.legacy.bibrecord import record_xml_output, record_add_field
from invenio.modules.formatter.api import get_tag_from_name
from invenio.legacy.search_engine import search_pattern, get_fieldvalues
from invenio.config import CFG_TMPDIR
from invenio.legacy.bibsched.bibtask import task_low_level_submission
from invenio.legacy.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
コード例 #6
0
ファイル: config.py プロジェクト: Theer108/invenio
#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: