Browse Source

added popups to eds targets and modified eds so we get the detailed record for each result

2.x-ebsco
Paul Pound 10 years ago
parent
commit
442c3bb371
  1. 26
      targets/eds/js/eds_results.js
  2. 34
      targets/eds/js/eds_results_article.js
  3. 12
      targets/eds/roblib_search_eds.module

26
targets/eds/js/eds_results.js

@ -13,12 +13,15 @@ Drupal.behaviors.roblib_search_eds = {
jQuery('#' + 'roblib-search-content-eds').empty().append('No Results');
jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-results').hide();
} else {
var counter = 0;
var divs = new Array();
var content = new Array();
jQuery.each(data.records, function(key, val) {
//items.push('<a class="roblib-search-eds-tn" href="'+val.ImageInfo.thumb+'"/>');
//jQuery.each(val.RecordInfo.BibEntity.Titles, function(key2, val2){
id = 'roblib-search-eds-' + counter;
edsPopulatePopupDivs(content, val, counter);
divs[counter++] = id;
if (typeof val.Items !== 'undefined') {
items.push('<div class ="roblib-search-row">');
items.push('<div class ="roblib-search-row" id="' + id + '">');
if (typeof val.Items.Ti !== 'undefined') {
jQuery.each(val.Items.Ti, function(key2, val2){
items.push('<div class="roblib-title eds">');
@ -51,8 +54,10 @@ Drupal.behaviors.roblib_search_eds = {
items.push('</div>');
}
});
}
jQuery('#' + 'roblib-search-content-eds').empty().append(items.join(''));
qtipify(divs, content, 'Notes');
}
var queries = [];
jQuery.each(data.queries, function(key7, query){
queries.push(query.query);
@ -64,3 +69,14 @@ Drupal.behaviors.roblib_search_eds = {
});
}
}
function edsPopulatePopupDivs(content, val, counter){
content[counter] = '';
jQuery.each(val.DetailedRecord, function(key, value){
if(value.Group == 'Note' || value.Group == 'TOC') {
content[counter] += '<div class="eds-popup-content"><span class="eds-popup-label">' + value.Label + '</span>' ;
content[counter] += '<span class="eds-popup-value"> ' + value.Data +'</span></div>';
}
})
}

34
targets/eds/js/eds_results_article.js

@ -13,12 +13,16 @@ Drupal.behaviors.roblib_search_eds_articles = {
jQuery('#' + 'roblib-search-content-eds').empty().append('No Results');
jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-articles').hide();
} else {
var counter = 0;
var divs = new Array();
var content = new Array();
jQuery.each(data.records, function(key, val) {
id = 'roblib-search-eds-article-' + counter;
edsPopulatePopupDivs(content, val, counter);
divs[counter++] = id;
//items.push('<a class="roblib-search-eds-tn" href="'+val.ImageInfo.thumb+'"/>');
//jQuery.each(val.RecordInfo.BibEntity.Titles, function(key2, val2){
if (typeof val.Items !== 'undefined') {
items.push('<div class ="roblib-search-row">');
items.push('<div class ="roblib-search-row" id="' + id +'">');
if (typeof val.Items.Ti !== 'undefined') {
jQuery.each(val.Items.Ti, function(key2, val2){
items.push('<div class="roblib-title eds">');
@ -35,16 +39,6 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('<div class="eds-src"><span class="eds-label">'+source.Label+':</span> '+source.Data+'</div>');
})
}
//if (typeof val.Items.PubIrInfo !== 'undefined') {
// jQuery.each(val.Items.PubIrInfo, function(key5, pubinfo){
// items.push('<div class="eds-pubinfo">'+pubinfo.Data+'</div>');
// })
//}
//if (typeof val.Items.TypPub !== 'undefined') {
// jQuery.each(val.Items.TypPub, function(key6, typpub){
// items.push('<div class="eds-type">'+typpub.Data+'</div>');
// })
//}
if (typeof val.PLink !== 'undefined'){
items.push('<div class="eds-db eds-pdf-link"><a href="'+val.PLink+'">Full Text</a></div>');
}
@ -53,8 +47,10 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('</div>');
}
});
}
jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join(''));
qtipify(divs, content, 'Notes');
}
var queries = [];
jQuery.each(data.queries, function(key7, query){
queries.push(query.query);
@ -66,3 +62,13 @@ Drupal.behaviors.roblib_search_eds_articles = {
});
}
}
/*function edsArticlesPopulatePopupDivs(content, val, counter){
content[counter] = '';
jQuery.each(val.DetailedRecord, function(key, value){
if(value.Group == 'Note') {
content[counter] += '<div class="eds-popup-content"><span class="eds-popup-label">' + value.Label + '</span>' ;
content[counter] += '<span class="eds-popup-value"> ' + value.Data +'</span></div>';
}
})
} */

12
targets/eds/roblib_search_eds.module

@ -237,9 +237,21 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) {
$query = urlencode($query);
$params = "query=AND,$query&view=detailed&includefacets=n&$limiters&resultsperpage=$number_per_page";
$output = $eds_api->apiSearch($params);
$output = roblib_search_eds_get_detailed_result($output, $query, $eds_api);
return json_encode($output);
}
function roblib_search_eds_get_detailed_result(&$output, $query, &$eds_api) {
$detailed_record = array();
foreach ($output['records'] as &$record) {
$db = $record['DbId'];
$an = $record['An'];
$arr = $eds_api->apiRetrieve($an, $db, $query);
$record['DetailedRecord'] = $arr['Items'];
}
return $output;
}
function roblib_search_eds_get_query_limiters($type) {
$limiters = 'n';
switch ($type) {

Loading…
Cancel
Save