From b99dee462c2bd3806c6bf8b061fdfe1296eb3595 Mon Sep 17 00:00:00 2001 From: Dorian Merz <merz@ub.uni-leipzig.de> Date: Mon, 25 Sep 2017 15:04:56 +0200 Subject: [PATCH] refs #11004 * list Amsl resources at extra page * call via route /Resources ** resources list with togglable collapse elements ** definition of api enpoint at instance level --- local/alpha/config/vufind/Amsl.ini | 22 ++ local/config/vufind/Amsl.ini | 19 ++ local/languages/de.ini | 14 +- local/languages/en.ini | 18 +- module/finc/config/module.config.php | 6 +- .../Controller/AmslResourceController.php | 190 ++++++++++++++++++ module/finc/src/finc/Controller/Factory.php | 17 ++ themes/finc/images/dfg_logo_text.png | Bin 0 -> 6100 bytes themes/finc/js/sources-display.js | 30 +++ themes/finc/scss/compiled.scss | 21 ++ themes/finc/templates/amsl/sources-list.phtml | 58 ++++++ 11 files changed, 387 insertions(+), 8 deletions(-) create mode 100644 local/alpha/config/vufind/Amsl.ini create mode 100644 local/config/vufind/Amsl.ini create mode 100644 module/finc/src/finc/Controller/AmslResourceController.php create mode 100755 themes/finc/images/dfg_logo_text.png create mode 100644 themes/finc/js/sources-display.js create mode 100644 themes/finc/templates/amsl/sources-list.phtml diff --git a/local/alpha/config/vufind/Amsl.ini b/local/alpha/config/vufind/Amsl.ini new file mode 100644 index 00000000000..63bb01b3c7b --- /dev/null +++ b/local/alpha/config/vufind/Amsl.ini @@ -0,0 +1,22 @@ +;#################################################################### +;##################### DO NOT DELETE THIS HEADER #################### +;################### Leipzig University Library © 2015 ############## +; +; This is the default ALPHA-INI-file and inherits +; all the settings from the INI-file defined in [Parent_Config] which +; points to the default INI-file located in the folder vufind2/local +; + +[Parent_Config] +relative_path = ../../../config/vufind/Amsl.ini + +; A comma-separated list of config sections from the parent which should be +; completely overwritten by the equivalent sections in this configuration; +; any sections not listed here will be merged on a section-by-section basis. +;override_full_sections = "Languages,AlphaBrowse_Types" + +; +; Add ALPHA-specific customization after this header. +; +;##################### DO NOT DELETE THIS HEADER #################### +;#################################################################### \ No newline at end of file diff --git a/local/config/vufind/Amsl.ini b/local/config/vufind/Amsl.ini new file mode 100644 index 00000000000..27d8d861fdf --- /dev/null +++ b/local/config/vufind/Amsl.ini @@ -0,0 +1,19 @@ +; Configuration file for the amsl metadata resources + +; Define api endpoint for requests +[API] +url = "{url}" +response_type = 'application/json' + +; Contains label patterns for two layers of source hierarchy +; these will normally be source and collection represented by main_label and sub_label, resp. +; use array_keys in double percent signs to be rendered in the labels +; the main label MUST contain the main key and the main key SHOULD identify the source +; same for the sub key and label +[Mapping] +main_key = 'source_id' +main_label = '%%source_id%%: %%source_label%%' +default_main_label = 'untitled source' +sub_key = 'collection_label' +sub_label = '%%collection_label%%' +default_sub_label = 'untilted collection' \ No newline at end of file diff --git a/local/languages/de.ini b/local/languages/de.ini index 2f42ddcbfd8..2a68b79e1e2 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -1877,7 +1877,7 @@ non_rda_original_title = "Originaltitel" ;#8828 German Prints Index Number = "VD-Nummer" -; LIDO RecordDriver relvant +; LIDO RecordDriver relevant expression creation = "Entstehungsvermerk" publication event = "Ausstellung" undated = "nicht datiert" @@ -1940,4 +1940,14 @@ Alternative Corporate Name = "Körperschaftennamenalternative" eds_expander_relatedsubjects = "Auf verwandte Schlagwörter ausweiten" MeSH Terms = "MeSH-Schlagwörter" Related Subjects = "Ähnliche Schlagwörter" -Subjects = "Schlagwörter" \ No newline at end of file +Subjects = "Schlagwörter" + +; List of available sources /Sources +List of available Sources = "Liste der durchsuchbaren Ressourcen" +sources_explanatory_line = "Folgende Ressourcen sind im lizenzierten Zeitraum durchsuchbar:" +Filter list = "Liste filtern" +Please enter filter term = "Bitte Begriff(e) zum Filtern eingeben" +Expand all = "Alle ausklappen" +Expand = "Ausklappen" +resources_cannot_received = "Fehler aufgetreten. Resourcen konnten nicht geladen werden" +support_by_dfg = "Die Nationallizenzen wurden gefördert durch die" \ No newline at end of file diff --git a/local/languages/en.ini b/local/languages/en.ini index a2db1eed716..a598c8eef18 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -394,7 +394,6 @@ errorcode_member_not_found = "The member number does not exist" errorcode_password_validation_error = "Your passed password is not correct" errorcode_old_password_validation_error = "Invalid combination of username and password, please check your entries." errorcode_empty_req_param_error = "All required fields have to be filled to submit successfully the form" - exclude_newspapers = "Exclude Newspaper Articles" export_download = "Download File" export_exporting = "Creating Export File" @@ -1818,7 +1817,7 @@ non_rda_original_title = "Original Title" ;#8828 German Prints Index Number = "German Prints Index Number" -; LIDO RecordDriver relvant +; LIDO RecordDriver relevant expression creation = "Expression creation" publication event = "Publication event" undated = "undated" @@ -1871,9 +1870,20 @@ Sport = "Sports" Technik = "Technics" Theologie und Religionswissenschaft = "Theology and Religious Studies" Wirtschaftswissenschaften = "Business and Economics" -#13402 Missing Translations in result-list + +; #13402 Missing Translations in result-list Varying Title = "Varying Title" Fulltext = "Fulltext" Classification = "Classification" Alternative Author Name = "Alternative Author Name" -Alternative Corporate Name = "Alternative Corporate Name" \ No newline at end of file +Alternative Corporate Name = "Alternative Corporate Name" + +; List of available sources Sources +List of available Sources = "List of searchable sources" +sources_explanatory_line = "The following ressources are searchable during the license period:" +Filter list = "Filter list " +Please enter filter term = "Please enter filter term(s)" +Expand all = "Expand all" +Expand = "Expand" +resources_cannot_received = "Error occurred. List of resources cannot loaded" +support_by_dfg = "National licenses were sponsored by " \ No newline at end of file diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index 8b56ea99640..23eea526354 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -17,10 +17,12 @@ $config = [ ], 'controllers' => [ 'factories' => [ - 'record' => 'finc\Controller\Factory::getRecordController', - 'dds' => 'finc\Controller\Factory::getDocumentDeliveryServiceController', 'ajax' => 'finc\Controller\Factory::getAjaxController', + 'dds' => + 'finc\Controller\Factory::getDocumentDeliveryServiceController', 'my-research' => 'finc\Controller\Factory::getMyResearchController', + 'record' => 'finc\Controller\Factory::getRecordController', + 'resources' => 'finc\Controller\Factory::getAmslResourceController' ], ], 'controller_plugins' => [ diff --git a/module/finc/src/finc/Controller/AmslResourceController.php b/module/finc/src/finc/Controller/AmslResourceController.php new file mode 100644 index 00000000000..37530c73821 --- /dev/null +++ b/module/finc/src/finc/Controller/AmslResourceController.php @@ -0,0 +1,190 @@ +<?php +/** + * Amsl API Controller + * + * PHP version 5 + * + * Copyright (C) Leipzig University Library 2018. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category finc + * @package Controller + * @author Dorian Merz <merz@ub.uni-leipzig.de> + * @author Ulf Seltmann <seltmann@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace finc\Controller; + +use VuFind\Controller\AbstractBase; + +/** + * Controller for the user account area. + * + * @category finc + * @package Controller + * @author Dorian Merz <merz@ub.uni-leipzig.de> + * @author Ulf Seltmann <seltmann@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class AmslResourceController extends AbstractBase +{ + /** + * Amsl.ini configuration. + * + * @var $config + * @access protected + */ + protected $config = []; + + /** + * HTTP client + * + * @var \Zend\Http\Client + * @access protected + */ + protected $httpClient; + + + /** + * Constructor + * + * @param \Zend\Config\Config $config VuFind configuration + * @param \VuFind\Http $httpClient HttpClient + */ + public function __construct( + \Zend\Config\Config $config, + \VuFindHttp\HttpService $httpClient + ) { + $this->config = $config; + $this->httpClient = $httpClient; + } + + /** + * Amsl action - controller method + * + * @return \Zend\View\Model\ViewModel + * @throws \Exception + * @access public + */ + public function homeAction() + { + // Make view + $api_conf = $this->config->get('API'); + $view = $this->createViewModel(); + try { + if ( + null == ( + $result + = $this->httpClient->get($api_conf->url) + ) + ) { + throw new \Exception( + 'Unexpected value: No api result received' + ); + } + if ($result->isSuccess()) { + switch ($api_conf->response_type) { + case 'application/json': + $amsl_sources = json_decode($result->getBody(), true); + break; + default: + throw new \Exception( + 'Invalid argument: No valid header scheme defined' + ); + break; + } + } + if (isset($amsl_sources)) { + $view->sources = $this->createSourceHierarchy($amsl_sources); + } + } + catch (\Exception $e) { + $this->flashMessenger()->addMessage( + 'resources_cannot_received', + 'error' + ); + } + $view->setTemplate('amsl/sources-list'); + return $view; + } + + /** + * Sorts the input array according to the values for main_key and sub_key + * + * @param array $amsl_sources + * + * @return array $out + * @access protected + */ + protected function createSourceHierarchy(array $amsl_sources) + { + $struct = $this->config->get('Mapping'); + $main_key = $struct->main_key; + $sub_key = $struct->sub_key; + $sources = []; + + foreach ($amsl_sources as $source) { + if (isset($source[$main_key])) { + if (isset($source[$sub_key])){ + $label = $this->renderLabel($struct->sub_label, $source); + $sources[$source[$main_key]][$label] = $source; + } else { + $sources[$source[$main_key]][$struct->default_sub_label] + = $source; + } + } else { + if (isset($source[$sub_key])){ + $label = $this->renderLabel($struct->sub_label, $source); + $default[$label] = $source; + } else { + $default[$struct->default_sub_label] = $source; + } + } + } + ksort($sources); + $out = []; + foreach ($sources as $main) { + $label = $this->renderLabel($struct->main_label, current($main)); + $out[$label] = $main; + } + if (isset($default)) $out[$struct->default_main_label] = $default; + return $out; + } + + /** + * Helper funtion to render label + * + * @param $pattern + * @param $input_array + * + * @return mixed + * @access protected + */ + protected function renderLabel($pattern, $input_array) { + $struct = []; + $replace = []; + preg_match_all('/\%\%(\w+)\%\%/', $pattern, $struct); + foreach ($struct[1] as $key) { + $replace[] = (isset($input_array[$key])) ? $input_array[$key] : ''; + } + return str_replace( + $struct[0], + $replace, + $pattern + ); + } +} diff --git a/module/finc/src/finc/Controller/Factory.php b/module/finc/src/finc/Controller/Factory.php index 8a70bd8eccd..ed37182fe73 100644 --- a/module/finc/src/finc/Controller/Factory.php +++ b/module/finc/src/finc/Controller/Factory.php @@ -81,6 +81,23 @@ class Factory extends FactoryBase ); } + + /** + * Construct the AmslResourceController. + * + * @param ServiceManager $sm Service manager. + * + * @return AmslResourceController + */ + public function getAmslResourceController(ServiceManager $sm) + { + return new AmslResourceController( + $sm->getServiceLocator()->get('VuFind/Config')->get('Amsl'), + $sm->getServiceLocator()->get('VuFind/Http') + ); + } + + /** * Construct the DocumentDeliveryServiceController. * diff --git a/themes/finc/images/dfg_logo_text.png b/themes/finc/images/dfg_logo_text.png new file mode 100755 index 0000000000000000000000000000000000000000..c76cd0967ad16a87617e62afafde5e82df854dca GIT binary patch literal 6100 zcmV;_7c1zAP)<h;3K|Lk000e1NJLTq00B(^001ip1^@s6{3_Zv00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+<Lqi~Na&Km7Y-Iodc-oy)XH-+^7Crag z^g>IBfRsybQWXdwQbLP>6p<z>Aqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uh<iVD~V z<RPMtgQJLw%KPDaqifc@_vX$1wbwr9tn;0-&j-K=43<bUQ8j=JsX`tR;Dg7+#^K~H zK!FM*Z~zbpvt%K2{UZSY_<lS*D<Z%Lz5oGu(+dayz)hRLFdT>f59&ghTmgWD0l;*T zI7<kC6aYYajzXpYKt=(8otP$50H6c_V9R4-;{Z@C0AMG7=F<Rxo%or10RUT+Ar%3j zkpLhQWr#!oXgdI`&sK^>09Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-<?i z0%4j!F2Z@488U%158(66005wo6%pWr^Zj_v4zAA5HjcIqUoGmt2LB>rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq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<Y(=<-{$`oh{#JFoD?6$(#OmE9H>ic+75$dxXPB?vF;B z&0lSvC#+${S4kIi4|mL~SP!?0gjeaA=C=n)vpTiiB6vZcH2{YvY6SAnwY3nXC6mu- z*bZf8>O)0&6X@=1&+c4G3TF8E<7gvX^4<P$xP%v^`}srd1RiVa7D^Ci_@JVHy_1?| z3UYWqUVZE$X%mmgZce;KYyk8M<|Ua`e$4@%YRa%`-dUx?C)e4Q>T99NRm?P269A)} zW<>4a){qw{zA&MCDP#-4ErbWP4+_aq!>rEF1*%5vHr&)x`z=+*fZHUyOKX}j50>@S z_%EyYYAB3jjC?@zIk3fLUvXTrOe>za5zDub7Qkbs(gNfcjgW<3VXv`~);<Dl5<DP_ ziLHCz_?pWIIcx^V2d>w}0OaTU;E<Z%yl_N0E%vy)5r>{l;RSb~O%xF?sLDD=7V|hq zw(I?jvH<n^{XF7+wxxc40{Og~FKAv6GC9Y}7>Y||747#dg=SS*1bi;@RqBVTV?bC1 zE&%Hn&il$@$}4^hiup@w<`LC=?$X4WvI#q5a(Us2)I>uN+RZ0Uy#=(MS(Y4>i_FUf z^7ou?Q4AAH4)oVZdRDk*<g}s;SJDPjWV@+ld5bZUN_9?h_m^jKdR&K8Y2&iV5|x<R zBgy=m^F(wi$r}#)tXYfAiIm%51v!qFWD#w%(2R{^a-8-(_4A{qpA+OmqjddHHip!) zEk%Y16dRc;vQ7(i$Xpqx^%pI~Hur-oEv6F`H@AvoD8nm19|Goxt;-=ZH=Gj)j0QmW zV^$6Fnx&6$_)o)pECByQF}T~HBQSRaT}}&)6jC&}9m2HOMBlcMn=fhc28J{Z46dFa z$Dq(C;W7~BpM|Pt6VU5<Z<4v`u-Ul1`VCS;ng#|25?thWy<^mmHJ1H*DQGihZko8e a`2PSvc!@1Oe;%j+0000<MNUMnLSTZ5F0Uv6 literal 0 HcmV?d00001 diff --git a/themes/finc/js/sources-display.js b/themes/finc/js/sources-display.js new file mode 100644 index 00000000000..10b71882660 --- /dev/null +++ b/themes/finc/js/sources-display.js @@ -0,0 +1,30 @@ +// Collapse nearest element on clicl +$('.collapse-toggler').click(function () { + $(this).next().collapse('toggle'); +}); + +// Collapse all button +$('.collapse-all-toggler').click(function () { + $('#sources-list li ul').collapse('toggle'); +}); + +// toggle chevron +function toggleChevron(e) { + $(e.target) + .prev('.collapse-toggler') + .find('i.fa') + .toggleClass('fa-chevron-down fa-chevron-up'); +} + +$('#sources-list').on('hidden.bs.collapse shown.bs.collapse', toggleChevron); + +// Sources filter +$('#sources-filter').keyup(function () { + var that = this, $allListElements = $('ul > li'); + var $matchingListElements = $allListElements.filter(function (i, li) { + var listItemText = $(li).text().toUpperCase(), searchText = that.value.toUpperCase(); + return ~listItemText.indexOf(searchText); + }); + $allListElements.hide(); + $matchingListElements.show(); +}); diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 5ca2f624cf4..2d06c7c5fef 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1594,6 +1594,27 @@ footer { //// Advanced Search - END +//// Sources List (/sources/home.phtml) +#sources-list { + line-height: 1.5; + // align to left edge + padding-left: 0; + + // remove list style on top level as sources have a number! + li { + list-style: none; + padding-bottom: .5em; + + // use list style on child elements + ul li { + list-style: initial; + padding-bottom: 0; + } + } +} +//// Sources List - END + + // MAIN CONTENT - END // SIDEBAR diff --git a/themes/finc/templates/amsl/sources-list.phtml b/themes/finc/templates/amsl/sources-list.phtml new file mode 100644 index 00000000000..088665028ff --- /dev/null +++ b/themes/finc/templates/amsl/sources-list.phtml @@ -0,0 +1,58 @@ +<!-- finc: amsl/sources-list - home --> +<? +// Set up page title: +$this->headTitle($this->translate('List of available Sources')); + +// Set up breadcrumbs: +$this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('List of available Sources') . '</li>'; +?> + +<h2><?=$this->transEsc('List of available Sources');?></h2> + +<?=$this->flashmessages()?> + +<? if (isset($this->sources)): ?> +<p><?=$this->transEsc('sources_explanatory_line');?></p> +<form> + <div class="form-group"> + <label for="sources-filter"><?=$this->transEsc('Filter list')?></label> + <input type="text" id="sources-filter" class="form-control" placeholder="<?=$this->transEsc('Please enter filter term')?>"> + </div> +</form> + +<p> + <button data-toggle="collapse" class="btn btn-default collapse-all-toggler" href="javascript:void(0)"><?=$this->transEsc('Expand all')?></button> +</p> + +<ul id="sources-list"> + <? foreach ($this->sources as $label => $source): ?> + <? if (!empty($source)): ?> + <li> + <a data-toggle="collapse" class="collapse-toggler" href="javascript:void(0)"> + <?=$label?> + <i class="fa fa-chevron-down" aria-hidden="true"></i> + <span class="sr-only"><?=$this->transEsc('Expand')?></span> + </a> + <ul class="panel-collapse collapse" aria-expanded="false"> + <? foreach ($source as $sub_label => $collection): ?> + <li><?=$sub_label?></li> + <? endforeach; ?> + </ul> + </li> + <? endif; ?> + <? endforeach; ?> +</ul> + +<div class="panel panel-primary"> + <div class="panel-body"><?=$this->transEsc('support_by_dfg'); ?> + <a href='http://www.dfg.de' target='_blank'> + <img src='<?=$this->imageLink('dfg_logo_text.png')?>' alt='Deutsche Forschungsgemeinschaft, DFG'> + </a> + </div> +</div> +<? endif; ?> + +<? /* run collapse togglers + introduce a case-insensitive filter that is capable of filtering multiple filtering terms */ + echo $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'sources-display.js', 'SET'); +?> +<!-- finc: amsl/sources-list - home - END --> -- GitLab