-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOI: Short-URLs via ZMSIndex #133
Comments
After shifting to ZMS core the ZMSIndex.doi()-function Lines 642 to 669 in 1bce511
works indirectly and has to be called within a Zope-Python-Script object to provide the traversal function which is needed to get the document id (DOI) from the URL path. Screen Image: Zope-Python-Script object 'short' calls the zmsindex.doi() function: The pictured example shows how to configure a Short-URL resolver based on the ZMS-IDs:
request = container.REQUEST
response = request.response
resp = container.content.zmsindex.doi()
return resp.getData()
return zmscontext.getId()
|
If you prefer to enter indivdual DOIs manually and you may want to change ( :-o ) these DOIs after the node was inserted, a refresh of the node's catalog item will be necessary. Because ZMSIndex by default is not affected by attribute changes, the reindexing can be triggered
$(function(){
const $doi_input = $('#tr_attr_dc_identifier_doi input');
const $btn_refresh_catalog = $('<a>', {
style:'float:right;margin-top:-2.175rem;border-radius:0 4px 4px 0;',
title:'Refresh Catalog Item',
class:'btn btn-primary ml-2'
}).on('click', function() {
if ( $doi_input.attr('data-initial-value')==$doi_input.prop('value') ) {
if ( confirm('Do You really want to refresh the Catalog item?') ) {
self.location.href='?refresh_catalog=True&manage_tabs_message=Reindexed';
}
} else {
confirm('Please save the new entry, first')
};
return false;
}).append($('<i>', {
title:'Refresh catalog',
class:'fas fa-sync-alt'
}));
$doi_input.after($btn_refresh_catalog);
}); NOTE: the triggering of catalog_refesh needs 8405e9d |
(zmsdev)
|
When ZMSIndex was a ContentObj-Lib the doi-Python-Script object
ZMS/Products/zms/import/com.zms.index-2.1.0.metaobj.xml
Lines 1296 to 1321 in 9e4e618
could resolve short-URls on basis of an attribute like
www.mysite.com/doi/myid
How does it work after the doi()-function has moved with ZMSIndex into ZMS core?
The text was updated successfully, but these errors were encountered: