Skip to content
Snippets Groups Projects
Commit f683f211 authored by André Lahmann's avatar André Lahmann
Browse files

refs #5636:

* updated searchspecs.yaml for better JournalTitle search
* removed getLinkISN() from Record view helper
* implemented three-way journal-link generation in SolrAI templates:
** first the containerId is used if any exists
** second search for an issn if any exist
** third and last search for journal title
parent b8cdc71a
No related merge requests found
......@@ -364,7 +364,7 @@ JournalTitle:
series2:
- [onephrase, 50]
- [and , ~]
FilterQuery: "format:Journal"
FilterQuery: "format:Journal OR format:Article OR format:ElectronicBookPart"
# ExactSettings:
# DismaxFields:
# - title_full_unstemmed^450
......
......@@ -364,7 +364,7 @@ JournalTitle:
series2:
- [onephrase, 50]
- [and , ~]
FilterQuery: "format:Journal"
FilterQuery: "format:Journal OR format:Article OR format:ElectronicBookPart"
# ExactSettings:
# DismaxFields:
# - title_full_unstemmed^450
......@@ -596,7 +596,7 @@ AllFields:
- [onephrase, 500]
imprint:
- [onephrase, 500]
# ExactSettings:
# DismaxFields:
# - title_full_unstemmed^600
......
......@@ -364,7 +364,7 @@ JournalTitle:
series2:
- [onephrase, 50]
- [and , ~]
FilterQuery: "format:Journal"
FilterQuery: "format:Journal OR format:Article OR format:ElectronicBookPart"
# ExactSettings:
# DismaxFields:
# - title_full_unstemmed^450
......
......@@ -119,7 +119,6 @@ class SolrAI extends SolrDefault implements
* place, publisher and data.
*
* @return array
* @access protected
*/
/*public function getFirstPublicationDetails()
{
......@@ -152,7 +151,6 @@ class SolrAI extends SolrDefault implements
* Has FirstPublicationsDetails a Date in it
*
* @return boolean
* @access protected
*/
protected function getIsPublicationDetailsDate()
{
......@@ -163,7 +161,6 @@ class SolrAI extends SolrDefault implements
* Get the main author of the record.
*
* @return string
* @access protected
*/
public function getPrimaryAuthor()
{
......@@ -174,7 +171,6 @@ class SolrAI extends SolrDefault implements
* Get additional entries for personal names.
*
* @return array
* @access protected
* @link http://www.loc.gov/marc/bibliographic/bd700.html
*/
protected function getAdditionalAuthors()
......@@ -222,7 +218,6 @@ class SolrAI extends SolrDefault implements
* getPublicationDates(), getPublishers() and getPlacesOfPublication().
*
* @return array
* @access protected
*/
public function getPublicationDetails()
{
......@@ -291,23 +286,19 @@ class SolrAI extends SolrDefault implements
}
/**
* Get the ISSN from a record.
* Get an array of all ISSNs associated with the record (may be empty).
*
* @return array
* @access protected
* @link https://intern.finc.info/fincproject/issues/969 description
*/
public function getISSNs()
{
return $this->getAIRecord('rft.issn');
return isset($this->fields['issn']) ? $this->fields['issn'] : [];
}
/**
* Get the eISSN from a record.
*
* @return array
* @access protected
* @link https://intern.finc.info/fincproject/issues/969 description
*/
public function getEISSNs()
{
......@@ -315,15 +306,13 @@ class SolrAI extends SolrDefault implements
}
/**
* Get an array of all ISSNs associated with the record (may be empty).
* Can be the main ISSN and the parent ISSNs.
* Get an array of all ISBNs associated with the record (may be empty).
*
* @return array
* @access protected
*/
public function getISBNs()
{
return $this->getAIRecord('rft.isbn');
return isset($this->fields['isbn']) ? $this->fields['isbn'] : [];
}
/**
......@@ -356,7 +345,6 @@ class SolrAI extends SolrDefault implements
* Return the jtitle field of ai records
*
* @return array Return jtitle fields.
* @access public
*/
public function getJTitle()
{
......@@ -367,7 +355,6 @@ class SolrAI extends SolrDefault implements
* Return the jtitle field of ai records
*
* @return array Return jtitle fields.
* @access public
*/
public function getATitle()
{
......@@ -378,7 +365,6 @@ class SolrAI extends SolrDefault implements
* Return the jtitle field of ai records
*
* @return array Return jtitle fields.
* @access public
*/
public function getBTitle()
{
......@@ -774,7 +760,6 @@ class SolrAI extends SolrDefault implements
* @param string $key Key of record array
*
* @return mixed value of key
* @access public
*/
public function getAIRecord($key = null)
{
......
......@@ -93,20 +93,6 @@ class Record extends \VuFind\View\Helper\Root\Record
$this->resolverConfig = $resolverConfig;
}
/**
* Render the link of the type ISN.
*
* @param array $issns Array with ISSNS
*
* @return string
*/
public function getLinkISN($issns)
{
return $this->renderTemplate(
'link-isn.phtml', ['issns' => $issns]
);
}
/**
* Render a (list of) record icons.
*
......
......@@ -71,8 +71,27 @@ if($loggedin = $this->auth()->isLoggedIn()) {
<?
$containerSource = $this->driver->getSourceIdentifier();
$containerID = $this->driver->getContainerRecordID();
// finc specific journalLink generation
$journalLink = '';
$issns = $this->driver->getISSNs();
// first try to link to container id (VuFind stock-behaviour)
if ($containerID) {
$journalLink = $this->recordLink()->getUrl("$containerSource|$containerID");
}
// second try to search issn (finc specific)
elseif (!empty($issns)) {
$journalLink = $this->record($this->driver)->getLink('isn', $issns);
}
// third search for journal title (VuFind stock-behaviour)
else {
$journalLink = $this->record($this->driver)->getLink('journaltitle', $journalTitle);
}
?>
<a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', $journalTitle))?>"><?=$this->escapeHtml($journalTitle)?></a>
<a href="<?=$journalLink?>"><?=$this->escapeHtml($journalTitle)?></a>
<? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?>
</td>
</tr>
......@@ -148,10 +167,12 @@ if($loggedin = $this->auth()->isLoggedIn()) {
<th><?=$this->transEsc('In')?>: </th>
<td>
<? $jtitle = $aidatain['jtitle']; $issns = $aidatain['issns']; if (!empty($issns)): ?>
<a href="<?=$this->record($this->driver)->getLinkISN($issns)?>">
<? if (!empty($jtitle)): ?><?=$this->escapeHtml($jtitle)?><? endif; ?>
</a><? elseif (!empty($jtitle)): ?><?=$this->escapeHtml($jtitle)?><? endif; ?><? $volume = $aidatain['volume']; if (!empty($volume)): ?><? if (empty($jtitle)): ?>, <? endif; ?><?=$this->escapeHtml($volume) ?><? endif; ?><? $date = $aidatain['date']; if (!empty($date)): ?><? if (empty($volume)): ?>, <? endif; ?>(<?=$this->escapeHtml($date) ?>)<? endif; ?><? $issue = $aidatain['issue']; if (!empty($issue)): ?>, <?=$this->escapeHtml($issue) ?><? endif; ?><? $pages = $aidatain['pages']; if (!empty($pages)): ?>, <?=$this->transEsc('p.')?> <?=$this->escapeHtml($pages) ?><? endif; ?>
</td>
<a href="<?=$this->record($this->driver)->getLink('isn', $issns)?>"><? if (!empty($jtitle)): ?><?=$this->escapeHtml($jtitle)?><? endif; ?></a>
<? elseif (!empty($jtitle)): ?>
<?=$this->escapeHtml($jtitle)?>
<? endif; ?>
<? $volume = $aidatain['volume']; if (!empty($volume)): ?><? if (empty($jtitle)): ?>, <? endif; ?><?=$this->escapeHtml($volume) ?><? endif; ?><? $date = $aidatain['date']; if (!empty($date)): ?><? if (empty($volume)): ?>, <? endif; ?>(<?=$this->escapeHtml($date) ?>)<? endif; ?><? $issue = $aidatain['issue']; if (!empty($issue)): ?>, <?=$this->escapeHtml($issue) ?><? endif; ?><? $pages = $aidatain['pages']; if (!empty($pages)): ?>, <?=$this->transEsc('p.')?> <?=$this->escapeHtml($pages) ?><? endif; ?>
</td>
</tr>
<? endif; ?>
......
<?=$this->url('search-results')?>?join=AND&amp;bool0[]=AND&amp;<? $issns = $this->issns; if (isset($issns)): ?><? foreach ($issns as $issn): ?>lookfor0[]=<?=$this->escapeHtml($issn)?>&amp;type0[]=ISN&amp;<? endforeach; ?><? endif; ?>sort=year&amp;view=list
\ No newline at end of file
<?
// use advanced search if we have multiple issns
if (is_array($this->lookfor) && count($this->lookfor) > 1) {
$query = '?join=AND&amp;bool0[]=AND&amp;';
foreach ($this->lookfor as $issn) {
$query .= 'lookfor0[]=' . urlencode($issn) . '&amp;type0[]=ISN';
}
} elseif (count($this->lookfor) == 1) {
$query = '?lookfor=%22' . urlencode($this->lookfor[0]) . '%22&amp;type=ISN';
} else {
$query = '?lookfor=%22' . urlencode($this->lookfor) . '%22&amp;type=ISN';
}
?>
<?=$this->url('search-results') . $query?>
\ No newline at end of file
......@@ -36,10 +36,31 @@
<? if (!empty($journalTitle)): ?>
<?=!empty($summAuthor) ? '<br />' : ''?>
<?=$this->transEsc('Published in')?>
<? $containerSource = $this->driver->getSourceIdentifier(); ?>
<? $containerID = $this->driver->getContainerRecordID(); ?>
<?
$containerSource = $this->driver->getSourceIdentifier();
$containerID = $this->driver->getContainerRecordID();
// finc specific journalLink generation
$journalLink = '';
$issns = $this->driver->getISSNs();
// first try to link to container id (VuFind stock-behaviour)
if ($containerID) {
$journalLink = $this->recordLink()->getUrl("$containerSource|$containerID");
}
// second try to search issn (finc specific)
elseif (!empty($issns)) {
$journalLink = $this->record($this->driver)->getLink('isn', $issns);
}
// third search for journal title (VuFind stock-behaviour)
else {
$journalLink = $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle));
}
?>
<? /* TODO: handle highlighting more elegantly here: */?>
<a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a>
<a href="<?=$journalLink?>"><?=$this->highlight($journalTitle) ?></a>
<?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
<? elseif (!empty($summDate)): ?>
<?=!empty($summAuthor) ? '<br />' : ''?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment