Ejemplo n.º 1
0
def viewhistoryday(req, oai_src_id=0, ln=CFG_SITE_LANG, confirm=0, year=None, month=None, day=None, start=0):
    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln,
    )
    d_date = datetime.datetime.now()
    if year == None:
        year = d_date.year
    if month == None:
        month = d_date.month
    if day == None:
        day = d_date.day
    try:
        uid = getUid(req)
    except Error, e:
        return page(
            title="OAI Harvest Admin Interface - Error",
            body=e,
            uid=uid,
            language=ln,
            navtrail=navtrail_previous_links,
            lastupdated=__lastupdated__,
            req=req,
        )
Ejemplo n.º 2
0
def harvest(req,
            oai_src_id=None,
            ln=CFG_SITE_LANG,
            record_id=None,
            enable_reporting=None,
            confirm=0):
    form = dict(req.form)
    content = {
        'confirm': (int, confirm),
        'enable_reporting': (str, enable_reporting),
        'record_id': (str, record_id),
        'oai_src_id': (str, oai_src_id),
        'ln': (str, ln),
    }
    argd = wash_urlargd(form, content)

    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' \
                                              % (CFG_SITE_URL, ln), ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=argd['ln'],
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 3
0
def editsource(req,
               oai_src_id=None,
               oai_src_name='',
               oai_src_baseurl='',
               oai_src_prefix='',
               oai_src_frequency='',
               oai_src_config='',
               oai_src_post='',
               ln=CFG_SITE_LANG,
               mtype='',
               callback='yes',
               confirm=-1,
               oai_src_sets=[],
               oai_src_bibfilter=''):
    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 4
0
def editsource(
    req,
    oai_src_id=None,
    oai_src_name="",
    oai_src_baseurl="",
    oai_src_prefix="",
    oai_src_frequency="",
    oai_src_config="",
    oai_src_post="",
    ln=CFG_SITE_LANG,
    mtype="",
    callback="yes",
    confirm=-1,
    oai_src_sets=[],
    oai_src_bibfilter="",
):
    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln,
    )

    try:
        uid = getUid(req)
    except Error, e:
        return page(
            title="OAI Harvest Admin Interface - Error",
            body=e,
            uid=uid,
            language=ln,
            navtrail=navtrail_previous_links,
            lastupdated=__lastupdated__,
            req=req,
        )
Ejemplo n.º 5
0
def viewhistoryday(req,
                   oai_src_id=0,
                   ln=CFG_SITE_LANG,
                   year=None,
                   month=None,
                   day=None,
                   start=0):
    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln)
    d_date = datetime.datetime.now()
    if year == None:
        year = d_date.year
    if month == None:
        month = d_date.month
    if day == None:
        day = d_date.day
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 6
0
def addsource(req, **kwargs):
    post_arguments = [("%s_%s" % (mode[0], arg['name']), type(arg['value'])) \
                       for mode in CFG_OAI_POSSIBLE_POSTMODES \
                       for arg in mode[2]]
    form = dict(req.form)
    content = {
        'ln': (str, "en"),
        'oai_src_name': (str, ""),
        'oai_src_baseurl': (str, ""),
        'oai_src_prefix': (str, ""),
        'oai_src_frequency': (str, ""),
        'oai_src_lastrun': (str, ""),
        'oai_src_comment': (str, ""),
        'oai_src_post': (list, None),
        'confirm': (int, -1),
        'oai_src_sets': (list, None)
    }
    for argument_name, argument_type in post_arguments:
        if argument_type == str:
            content[argument_name] = (str, "")
        elif argument_type == list:
            content[argument_name] = (list, [])

    argd = wash_urlargd(form, content)
    ln = argd['ln']
    oai_src_name = argd['oai_src_name']
    oai_src_baseurl = argd['oai_src_baseurl']
    oai_src_prefix = argd['oai_src_prefix']
    oai_src_frequency = argd['oai_src_frequency']
    oai_src_lastrun = argd['oai_src_lastrun']
    oai_src_comment = argd['oai_src_comment']
    oai_src_post = argd['oai_src_post']
    confirm = argd['confirm']
    oai_src_sets = argd['oai_src_sets']
    if oai_src_sets == None:
        oai_src_sets = []
    if oai_src_post == None:
        oai_src_post = []

    oai_src_args = {}
    for argument_name, dummy in post_arguments:
        oai_src_args[argument_name] = argd[argument_name]

    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 7
0
def addsource(req, **kwargs):
    post_arguments = [("%s_%s" % (mode[0], arg['name']), type(arg['value'])) \
                       for mode in CFG_OAI_POSSIBLE_POSTMODES \
                       for arg in mode[2]]
    form = dict(req.form)
    content = {'ln': (str, "en"),
               'oai_src_name': (str, ""),
               'oai_src_baseurl': (str, ""),
               'oai_src_prefix': (str, ""),
               'oai_src_frequency': (str, ""),
               'oai_src_lastrun': (str, ""),
               'oai_src_comment': (str, ""),
               'oai_src_post': (list, None),
               'confirm': (int, -1),
               'oai_src_sets': (list, None)}
    for argument_name, argument_type in post_arguments:
        if argument_type == str:
            content[argument_name] = (str, "")
        elif argument_type == list:
            content[argument_name] = (list, [])

    argd = wash_urlargd(form, content)
    ln = argd['ln']
    oai_src_name = argd['oai_src_name']
    oai_src_baseurl = argd['oai_src_baseurl']
    oai_src_prefix = argd['oai_src_prefix']
    oai_src_frequency = argd['oai_src_frequency']
    oai_src_lastrun = argd['oai_src_lastrun']
    oai_src_comment = argd['oai_src_comment']
    oai_src_post = argd['oai_src_post']
    confirm = argd['confirm']
    oai_src_sets = argd['oai_src_sets']
    if oai_src_sets == None:
        oai_src_sets = []
    if oai_src_post == None:
        oai_src_post = []

    oai_src_args = {}
    for argument_name, dummy in post_arguments:
        oai_src_args[argument_name] = argd[argument_name]

    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' % (CFG_SITE_URL, ln), ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 8
0
def viewholdingpen(req, filter = "", ln=CFG_SITE_LANG):
    navtrail_previous_links = oha.getnavtrail() + """&gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py">BibHarvest Admin Interface</a> """ % (CFG_SITE_URL)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="BibHarvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 9
0
def preview_harvested_xml(req, oai_src_id = None, ln=CFG_SITE_LANG, record_id = None):
    navtrail_previous_links = oha.getnavtrail() + """&gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py">OAI Harvest Admin Interface</a> """ % (CFG_SITE_URL)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 10
0
def reharvest(req, oai_src_id=None, ln=CFG_SITE_LANG, confirm=0, **records):
    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' % (CFG_SITE_URL, ln), ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 11
0
def viewholdingpen(req, filter_key = "", ln=CFG_SITE_LANG):
    navtrail_previous_links = oha.getnavtrail() + """&gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py">OAIHarvest Admin Interface</a> """ % (CFG_SITE_URL)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAIHarvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 12
0
def reharvest(req, oai_src_id=None, ln=CFG_SITE_LANG, **records):
    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' % (CFG_SITE_URL, ln), ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 13
0
def preview_harvested_xml(req, oai_src_id=None, ln=CFG_SITE_LANG, record_id=None):
    navtrail_previous_links = oha.getnavtrail() + """&gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py">OAI Harvest Admin Interface</a> """ % (CFG_SITE_URL)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 14
0
def delhprecord(req, ln=CFG_SITE_LANG, confirm=0, task_id = 0, hpupdate_id = 0):
    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/bibharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' % (CFG_SITE_URL, ln), ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 15
0
def addsource(req, ln=CFG_SITE_LANG, oai_src_name='', oai_src_baseurl ='', oai_src_prefix='', oai_src_frequency='', oai_src_lastrun='', oai_src_config='', oai_src_post='', confirm=-1, oai_src_sets=[], oai_src_bibfilter=''):
    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' % (CFG_SITE_URL, ln), ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 16
0
def index(req, ln=CFG_SITE_LANG):
    """Main OAI Harvest admin page"""
    navtrail_previous_links = oha.getnavtrail(ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 17
0
def index(req, ln=CFG_SITE_LANG):
    """Main OAI Harvest admin page"""
    navtrail_previous_links = oha.getnavtrail(ln=ln)

    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 18
0
def viewtasklogs(req, ln=CFG_SITE_LANG, task_id=0):
    navtrail_previous_links = oha.getnavtrail(
        ' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> '
        % (CFG_SITE_URL, ln),
        ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
Ejemplo n.º 19
0
def harvest(req, oai_src_id=None, ln=CFG_SITE_LANG, record_id=None):
    form = dict(req.form)
    content = {
               'confirm': (int, 0),
               'enable_reporting': (str, None),
               'record_id': (str, record_id),
               'oai_src_id': (str, oai_src_id),
               'ln': (str, ln),
               }
    argd = wash_urlargd(form, content)

    navtrail_previous_links = oha.getnavtrail(' &gt; <a class="navtrail" href="%s/admin/oaiharvest/oaiharvestadmin.py?ln=%s">OAI Harvest Admin Interface</a> ' \
                                              % (CFG_SITE_URL, ln), ln=ln)
    try:
        uid = getUid(req)
    except Error, e:
        return page(title="OAI Harvest Admin Interface - Error",
                    body=e,
                    uid=uid,
                    language=argd['ln'],
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)