Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F69873431
bibindexadmin.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 3, 23:30
Size
26 KB
Mime Type
text/x-c
Expires
Fri, Jul 5, 23:30 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18751114
Attached To
R3600 invenio-infoscience
bibindexadmin.py
View Options
## Administrator interface for WebSearch
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware 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.
##
## The CDSware 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 CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## read config variables:
#include "config.wml"
#include "configbis.wml"
<
protect
>
## $Id$</protect>
<
protect
>
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.</protect>
"""CDSware BibIndex Administrator Interface."""
__lastupdated__
=
"""<: print `date +"%d %b %Y %H:%M:%S %Z"`; :>"""
## fill config variables:
pylibdir
=
"<LIBDIR>/python"
import
sys
sys
.
path
.
append
(
'
%s
'
%
pylibdir
)
import
cdsware.bibindexadminlib
as
bic
reload
(
bic
)
from
cdsware.webpage
import
page
,
create_error_box
from
cdsware.config
import
weburl
,
cdslang
from
cdsware.webuser
import
getUid
__version__
=
"$Id$"
def
deletetag
(
req
,
fldID
,
ln
=
cdslang
,
tagID
=-
1
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_deletetag
(
fldID
=
fldID
,
ln
=
ln
,
tagID
=
tagID
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
addtag
(
req
,
fldID
,
ln
=
cdslang
,
value
=
[
''
,
-
1
],
name
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_addtag
(
fldID
=
fldID
,
ln
=
ln
,
value
=
value
,
name
=
name
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyfieldtags
(
req
,
fldID
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_modifyfieldtags
(
fldID
=
fldID
,
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
addindexfield
(
req
,
idxID
,
ln
=
cdslang
,
fldID
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_addindexfield
(
idxID
=
idxID
,
ln
=
ln
,
fldID
=
fldID
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyindexfields
(
req
,
idxID
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_modifyindexfields
(
idxID
=
idxID
,
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
showdetailsfieldtag
(
req
,
fldID
,
tagID
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_showdetailsfieldtag
(
fldID
=
fldID
,
tagID
=
tagID
,
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
showdetailsfield
(
req
,
fldID
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_showdetailsfield
(
fldID
=
fldID
,
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyfield
(
req
,
fldID
,
ln
=
cdslang
,
code
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_modifyfield
(
fldID
=
fldID
,
ln
=
ln
,
code
=
code
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyindex
(
req
,
idxID
,
ln
=
cdslang
,
idxNAME
=
''
,
idxDESC
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_modifyindex
(
idxID
=
idxID
,
ln
=
ln
,
idxNAME
=
idxNAME
,
idxDESC
=
idxDESC
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifytag
(
req
,
fldID
,
tagID
,
ln
=
cdslang
,
name
=
''
,
value
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_modifytag
(
fldID
=
fldID
,
tagID
=
tagID
,
ln
=
ln
,
name
=
name
,
value
=
value
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
deletefield
(
req
,
fldID
,
ln
=
cdslang
,
confirm
=
0
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_deletefield
(
fldID
=
fldID
,
ln
=
ln
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
deleteindex
(
req
,
idxID
,
ln
=
cdslang
,
confirm
=
0
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_deleteindex
(
idxID
=
idxID
,
ln
=
ln
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
showfieldoverview
(
req
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage logical fields"
,
body
=
bic
.
perform_showfieldoverview
(
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
editfields
(
req
,
ln
=
cdslang
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage logical fields"
,
body
=
bic
.
perform_editfields
(
ln
=
ln
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
editfield
(
req
,
fldID
,
ln
=
cdslang
,
mtype
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_editfield
(
fldID
=
fldID
,
ln
=
ln
,
mtype
=
mtype
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
editindex
(
req
,
idxID
,
ln
=
cdslang
,
mtype
=
''
,
callback
=
'yes'
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_editindex
(
idxID
=
idxID
,
ln
=
ln
,
mtype
=
mtype
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyindextranslations
(
req
,
idxID
,
ln
=
cdslang
,
sel_type
=
''
,
trans
=
[],
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_modifyindextranslations
(
idxID
=
idxID
,
ln
=
ln
,
sel_type
=
sel_type
,
trans
=
trans
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
modifyfieldtranslations
(
req
,
fldID
,
ln
=
cdslang
,
sel_type
=
''
,
trans
=
[],
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_modifyfieldtranslations
(
fldID
=
fldID
,
ln
=
ln
,
sel_type
=
sel_type
,
trans
=
trans
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
addfield
(
req
,
ln
=
cdslang
,
fldNAME
=
''
,
code
=
''
,
callback
=
"yes"
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage logical fields"
,
body
=
bic
.
perform_addfield
(
ln
=
cdslang
,
fldNAME
=
fldNAME
,
code
=
code
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
navtrail
=
navtrail_previous_links
,
urlargs
=
req
.
args
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
addindex
(
req
,
ln
=
cdslang
,
idxNAME
=
''
,
callback
=
"yes"
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage Indexes"
,
body
=
bic
.
perform_addindex
(
ln
=
cdslang
,
idxNAME
=
idxNAME
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
navtrail
=
navtrail_previous_links
,
urlargs
=
req
.
args
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
switchtagscore
(
req
,
fldID
,
id_1
,
id_2
,
ln
=
cdslang
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_switchtagscore
(
fldID
=
fldID
,
id_1
=
id_1
,
id_2
=
id_2
,
ln
=
ln
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
removeindexfield
(
req
,
idxID
,
fldID
,
ln
=
cdslang
,
callback
=
"yes"
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/index">Manage Indexes</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Index"
,
body
=
bic
.
perform_removeindexfield
(
idxID
=
idxID
,
fldID
=
fldID
,
ln
=
cdslang
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
navtrail
=
navtrail_previous_links
,
urlargs
=
req
.
args
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
removefieldtag
(
req
,
fldID
,
tagID
,
ln
=
cdslang
,
callback
=
"yes"
,
confirm
=-
1
):
navtrail_previous_links
=
bic
.
getnavtrail
()
+
"""> <a class=navtrail href="%s/admin/bibindex/bibindexadmin.py/field">Manage logical fields</a> """
%
(
weburl
)
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Edit Logical Field"
,
body
=
bic
.
perform_removefieldtag
(
fldID
=
fldID
,
tagID
=
tagID
,
ln
=
cdslang
,
callback
=
callback
,
confirm
=
confirm
),
uid
=
uid
,
language
=
ln
,
navtrail
=
navtrail_previous_links
,
urlargs
=
req
.
args
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
index
(
req
,
ln
=
cdslang
,
mtype
=
''
,
content
=
''
):
navtrail_previous_links
=
bic
.
getnavtrail
()
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage Indexes"
,
body
=
bic
.
perform_index
(
ln
=
ln
,
mtype
=
mtype
,
content
=
content
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
field
(
req
,
ln
=
cdslang
,
mtype
=
''
,
content
=
''
):
navtrail_previous_links
=
bic
.
getnavtrail
()
try
:
uid
=
getUid
(
req
)
except
MySQLdb
.
Error
,
e
:
return
error_page
(
req
)
auth
=
bic
.
check_user
(
uid
,
'cfgbibindex'
)
if
not
auth
[
0
]:
return
page
(
title
=
"Manage logical fields"
,
body
=
bic
.
perform_field
(
ln
=
ln
,
mtype
=
mtype
,
content
=
content
),
uid
=
uid
,
language
=
ln
,
urlargs
=
req
.
args
,
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
else
:
return
auth_failed
(
uid
,
navtrail_previous_links
,
auth
[
1
])
def
error_page
(
req
):
return
page
(
title
=
msg_internal_error
[
ln
],
body
=
create_error_box
(
req
,
verbose
=
verbose
,
ln
=
ln
),
description
=
"
%s
- Internal Error"
%
cdsname
,
keywords
=
"
%s
, CDSware, Internal Error"
%
cdsname
,
language
=
ln
,
urlargs
=
req
.
args
)
def
auth_failed
(
uid
,
navtrail_previous_links
,
message
=
""
):
return
page
(
title
=
'Authorization failure'
,
uid
=
uid
,
body
=
bic
.
adderrorbox
(
'Reason:'
,
datalist
=
[
message
]),
navtrail
=
navtrail_previous_links
,
lastupdated
=
__lastupdated__
)
Event Timeline
Log In to Comment