<commit_before>## $Id$
## Administrator interface for the OAI repository and archive

## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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.

"""CDS Invenio OAI Repository and Archive Administrator Interface."""

__revision__ = "$Id$"

import sys
import cgi
import re
import os
import string
import ConfigParser
import time
import random
import urllib
from mod_python import apache

from invenio.config import \
     cdslang, \
     tmpdir, \
     version, \
     weburl
import invenio.access_control_engine as access_manager
from invenio.dbquery import run_sql
from invenio.webpage import page, pageheaderonly, pagefooteronly
from invenio.webuser import getUid, get_email
from invenio.oaiarchive_engine import parse_set_definition
import invenio.template
bibharvest_templates = invenio.template.load('bibharvest')

tmppath = tmpdir + '/oaiarchiveadmin.' + str(os.getpid())
guideurl = "help/admin/bibharvest-admin-guide"

def getnavtrail(previous = ''):
    """Get navtrail"""
    return bibharvest_templates.tmpl_getnavtrail(previous = previous, ln = cdslang)

def perform_request_index(ln=cdslang):
    """OAI archive admin index"""

    out = '''<p>Define below the sets to expose through the OAI harvesting
    protocol. <br /> You will have to run the
    <a href="%(weburl)s/help/admin/bibharvest-admin-guide#3.2"><code>oaiarchive</code></a>
    utility to apply the settings you have defined here.</p>''' % {'weburl': weburl}

    titlebar = bibharvest_templates.tmpl_draw_titlebar(ln = cdslang,<commit_msg>Removed unnecessary 'from mod_python import apache' statement.<commit_after>## $Id$
## Administrator interface for the OAI repository and archive

## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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.

"""CDS Invenio OAI Repository and Archive Administrator Interface."""

__revision__ = "$Id$"

import sys
import cgi
import re
import os
import string
import ConfigParser
import time
import random
import urllib


from invenio.config import \
     cdslang, \
     tmpdir, \
     version, \
     weburl
import invenio.access_control_engine as access_manager
from invenio.dbquery import run_sql
from invenio.webpage import page, pageheaderonly, pagefooteronly
from invenio.webuser import getUid, get_email
from invenio.oaiarchive_engine import parse_set_definition
import invenio.template
bibharvest_templates = invenio.template.load('bibharvest')

tmppath = tmpdir + '/oaiarchiveadmin.' + str(os.getpid())
guideurl = "help/admin/bibharvest-admin-guide"

def getnavtrail(previous = ''):
    """Get navtrail"""
    return bibharvest_templates.tmpl_getnavtrail(previous = previous, ln = cdslang)

def perform_request_index(ln=cdslang):
    """OAI archive admin index"""

    out = '''<p>Define below the sets to expose through the OAI harvesting
    protocol. <br /> You will have to run the
    <a href="%(weburl)s/help/admin/bibharvest-admin-guide#3.2"><code>oaiarchive</code></a>
    utility to apply the settings you have defined here.</p>''' % {'weburl': weburl}

    titlebar = bibharvest_templates.tmpl_draw_titlebar(ln = cdslang,
{'fraction_non_alphanumeric': 0.09112867808519982, 'fraction_numerical': 0.018006148440931048, 'mean_word_length': 4.616522811344019, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5315469', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1336, 'n_words': 523}