Hi, All.
On Apr 13, 2009, at 5:50 PM, Devin Bougie wrote:
... If I try to manually browse to:
https://edms.classe.cornell.edu/submit/direct?RN=PICTURE-TEST-2009-001&sub=MPRPICTURE
, I am redirected to ...
After browsing CERN's installation, I discovered the correct format
for this link. It should be (for example):
https://edms.classe.cornell.edu/submit/sub?PICTURE_RN=PICTURE-TEST-2009-001@MPRPICTURE
Which is generated by the following BFE_PUBLIC_RECORD element:
------
"""BibFormat element - Prints a link to modify a records public status
"""
from invenio.access_control_engine import acc_authorize_action
from invenio.urlutils import create_html_link
from invenio.config import CFG_SITE_URL
def format(bfo):
"""
If authorized, prints a link to modify the public status of a
record.
"""
(auth_code, auth_message) = acc_authorize_action(bfo.user_info,
"submit", doctype="PICTURE", act="MPR")
if auth_code == 0:
link='<a href="' + CFG_SITE_URL + '/submit/sub?PICTURE_RN=' +
bfo.field("037__a") + '@MPRPICTURE">Modify restrictions</a>'
return link
return create_html_link(CFG_SITE_URL + '/submit/sub', \
urlargd={'PICTURE_RN':
bfo.field("037__a") + '@MPRPICTURE'}, \
link_label="Modify restrictions")
------
... The BFE_PUBLIC_RECORD element I created per your instructions
actually displays the html, not the link. For example, I see:
<a href="https://edms.classe.cornell.edu/submit/direct?RN=PICTURE-TEST-2009-001&sub=MPRPICTURE
">Modify restrictions</a>
This is still an issue, however. When I use either of the return
statements in the BFE_PUBLIC_RECORD element I list above, the record
displays the html of the link, not an actual link. The link only
works correctly if I add it directly to the template, but then I can't
conditionally displaying the link based on the user.
For example, if my format template contains:
------
<li><a href="<BFE_SERVER_INFO var='CFG_SITE_URL'/>/submit/sub?
PICTURE_RN=<BFE_PRIMARY_REPORT_NUMBER/>@MPRPICTURE">Modify
restrictions</a></li>
<BFE_PUBLIC_RECORD prefix="<li>" suffix="</li>" />
------
My record displays:
------
• Modify restrictions
• <a href="https://edms.classe.cornell.edu/submit/sub?PICTURE_RN=PICTURE-TEST-2009-004@MPRPICTURE
">Modify restrictions</a>
------
Any help would be greatly appreciated.
Many thanks,
Devin