Merge branch 'master' into allow-multiple-filegrps
This commit is contained in:
commit
ecd8ec8422
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: Task for the development fund
|
||||
about: A working package which may be sponsored by the Kitodo e.V. development fund.
|
||||
title: '[FUND] '
|
||||
title: "[FUND] "
|
||||
labels: development fund
|
||||
assignees: ''
|
||||
assignees: ""
|
||||
|
||||
---
|
||||
|
||||
|
@ -14,3 +14,17 @@ A clear and concise description of what should be developed.
|
|||
## Related Issues
|
||||
|
||||
Please check if there are already any [issues](https://github.com/kitodo/kitodo-presentation/issues) related to this task and link them here using `#issuenumber`.
|
||||
|
||||
## Expected Benefits of this Development
|
||||
|
||||
Please try to explain who will benefit of this development (administrators, editors, users, sales, ...).
|
||||
|
||||
## Estimated Costs and Complexity
|
||||
|
||||
Please try to estimate the costs and / or the complexity of the development.
|
||||
|
||||
e.g.
|
||||
|
||||
* **low** ~ less than 5 working days
|
||||
* **medium** ~ less than 10 working days
|
||||
* **high** ~ more than 10 working days
|
||||
|
|
|
@ -366,12 +366,6 @@ class Solr
|
|||
$params['filterquery'] = isset($params['filterquery']) ? $params['filterquery'] : [];
|
||||
// Restrict the fields to the required ones.
|
||||
$params['fields'] = 'uid,id';
|
||||
// Extend filter query to get all documents with the same uids.
|
||||
foreach ($params['filterquery'] as $key => $value) {
|
||||
if (isset($value['query'])) {
|
||||
$params['filterquery'][$key]['query'] = '{!join from=uid to=uid}' . $value['query'];
|
||||
}
|
||||
}
|
||||
// Set filter query to just get toplevel documents.
|
||||
$params['filterquery'][] = ['query' => 'toplevel:true'];
|
||||
// Set join query to get all documents with the same uids.
|
||||
|
|
|
@ -105,7 +105,7 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
*
|
||||
* @access protected
|
||||
*
|
||||
* @return string HTML input fields with current document's UID and parent ID
|
||||
* @return string HTML input fields with current document's UID
|
||||
*/
|
||||
protected function addCurrentDocument()
|
||||
{
|
||||
|
@ -117,20 +117,26 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
&& \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])
|
||||
) {
|
||||
$this->loadDocument();
|
||||
// Get document's UID or parent ID.
|
||||
// Get document's UID
|
||||
if ($this->doc->ready) {
|
||||
return '<input type="hidden" name="' . $this->prefixId . '[id]" value="' . ($this->doc->parentId > 0 ? $this->doc->parentId : $this->doc->uid) . '" />';
|
||||
return '<input type="hidden" name="' . $this->prefixId . '[id]" value="' . ($this->doc->uid) . '" />';
|
||||
}
|
||||
} elseif (!empty($list->metadata['options']['params']['filterquery'])) {
|
||||
// Get document's UID from search metadata.
|
||||
// The string may be e.g. "{!join from=uid to=partof}uid:{!join from=uid to=partof}uid:2" OR {!join from=uid to=partof}uid:2 OR uid:2"
|
||||
// or "collection_faceting:("Some Collection Title")"
|
||||
foreach ($list->metadata['options']['params']['filterquery'] as $facet) {
|
||||
$facetKeyVal = explode(':', $facet['query']);
|
||||
if ($facetKeyVal[0] == 'uid') {
|
||||
$documentId = (int) substr($facetKeyVal[1], 1, strpos($facetKeyVal[1], ')'));
|
||||
if (($lastUidPos = strrpos($facet['query'], 'uid:')) !== false) {
|
||||
$facetKeyVal = explode(':', substr($facet['query'], $lastUidPos));
|
||||
if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($facetKeyVal[1])) {
|
||||
$documentId = (int) $facetKeyVal[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($documentId)) {
|
||||
return '<input type="hidden" name="' . $this->prefixId . '[id]" value="' . $documentId . '" />';
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -453,7 +459,10 @@ class Search extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
!empty($this->piVars['id'])
|
||||
&& \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->piVars['id'])
|
||||
) {
|
||||
$params['filterquery'][]['query'] = 'uid:(' . $this->piVars['id'] . ') OR partof:(' . $this->piVars['id'] . ')';
|
||||
// Search in document and all subordinates (valid for up to three levels of hierarchy).
|
||||
$params['filterquery'][]['query'] = '_query_:"{!join from=uid to=partof}uid:{!join from=uid to=partof}uid:' . $this->piVars['id'] . '"' .
|
||||
' OR {!join from=uid to=partof}uid:' . $this->piVars['id'] .
|
||||
' OR uid:' . $this->piVars['id'];
|
||||
$label .= htmlspecialchars(sprintf($this->pi_getLL('in', ''), Document::getTitle($this->piVars['id'])));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,13 @@ class FulltextTool extends \Kitodo\Dlf\Common\AbstractPlugin
|
|||
}
|
||||
}
|
||||
if (!empty($fullTextFile)) {
|
||||
$markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext:' . htmlspecialchars($this->pi_getLL('fulltext', '')) . ';fulltext-on:' . htmlspecialchars($this->pi_getLL('fulltext-on', '')) . ';fulltext-off:' . htmlspecialchars($this->pi_getLL('fulltext-off', '')) . ';activate-full-text-initially:' . MathUtility::forceIntegerInRange($this->conf['activateFullTextInitially'], 0, 1, 0) . ';full-text-scroll-element:' . $this->conf['fullTextScrollElement'] . '"> </a>';
|
||||
$markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="'
|
||||
. 'fulltext:' . htmlspecialchars($this->pi_getLL('fulltext', ''))
|
||||
. ';fulltext-on:' . htmlspecialchars($this->pi_getLL('fulltext-on', ''))
|
||||
. ';fulltext-off:' . htmlspecialchars($this->pi_getLL('fulltext-off', ''))
|
||||
. ';activate-full-text-initially:' . MathUtility::forceIntegerInRange($this->conf['activateFullTextInitially'], 0, 1, 0)
|
||||
. ';full-text-scroll-element:' . $this->conf['fullTextScrollElement']
|
||||
. ';search-hl-parameters:' . $this->conf['searchHlParameters'] . '"> </a>';
|
||||
} else {
|
||||
$markerArray['###FULLTEXT_SELECT###'] = '<span class="no-fulltext">' . htmlspecialchars($this->pi_getLL('fulltext-not-available', '')) . '</span>';
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ limitations under the License.
|
|||
<!-- Image number where this document starts. -->
|
||||
<field name="page" type="int" indexed="false" stored="true" required="true" default="0" />
|
||||
<!-- Unique identifier for the parent document in the TYPO3 database. Only if this is a multi-volume work! -->
|
||||
<field name="partof" type="int" indexed="true" stored="true" required="true" default="0" />
|
||||
<field name="partof" type="int" indexed="true" stored="true" required="true" default="0" docValues="true" />
|
||||
<!-- Unique identifier for the root document in the TYPO3 database. Only if this is a multi-volume work! -->
|
||||
<field name="root" type="int" indexed="true" stored="true" required="true" default="0" />
|
||||
<!-- XML ID of this document in the METS file. This is only unique within the METS file! -->
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
plugin.tx_dlf_annotationtool.templateFile = EXT:dlf/Resources/Private/Templates/AnnotationTool.tmpl
|
||||
plugin.tx_dlf_fulltexttool.activateFullTextInitially = 0
|
||||
plugin.tx_dlf_fulltexttool.fullTextScrollElement = html, body
|
||||
plugin.tx_dlf_fulltexttool.searchHlParameters = tx_dlf[highlight_word]
|
||||
plugin.tx_dlf_fulltexttool.templateFile = EXT:dlf/Resources/Private/Templates/FulltextTool.tmpl
|
||||
plugin.tx_dlf_fulltextdownloadtool.templateFile = EXT:dlf/Resources/Private/Templates/FulltextDownloadTool.tmpl
|
||||
plugin.tx_dlf_imagedownloadtool.templateFile = EXT:dlf/Resources/Private/Templates/ImageDownloadTool.tmpl
|
||||
|
|
|
@ -1037,7 +1037,9 @@ Fulltext Tool
|
|||
^^^^^^^^^^^^^
|
||||
This plugin adds an activation link for fulltext to the toolbox. If no fulltext is available for the current page, a span-tag is rendered instead.
|
||||
|
||||
The default behaviour is to show the fulltext after click on the toggle link. There is a TypoScript configuration to show the fulltext initially.
|
||||
The default behavior is to show the fulltext after click on the toggle link. There is a TypoScript configuration to show the fulltext initially.
|
||||
|
||||
Plugin allows also to configure (searchHlParameters) by which URL parameters words will be highlighted in the image. The first defined parameter on the configuration has highest priority, if not found it checks the next ones.
|
||||
|
||||
:typoscript:`plugin.tx_dlf_fulltexttool.`
|
||||
|
||||
|
@ -1071,7 +1073,14 @@ The default behaviour is to show the fulltext after click on the toggle link. Th
|
|||
:Default:
|
||||
html, body
|
||||
|
||||
- :Property:
|
||||
searchHlParameters
|
||||
:Data Type:
|
||||
:ref:`t3tsref:data-type-string`
|
||||
:Default:
|
||||
tx_dlf[highlight_word]
|
||||
|
||||
The fulltext is fetched and rendered by JavaSript into the `<div id="tx-dlf-fulltextselection">` of the pageview plugin.
|
||||
|
||||
**Please note**: To allow JavaScript fetching the fulltext, the `CORS headers <https://en.wikipedia.org/wiki/Cross-origin_resource_sharing>`_ muste be configured appropriate on the providing webserver.
|
||||
The fulltext is fetched and rendered by JavaScript into the `<div id="tx-dlf-fulltextselection">` of the pageview plugin.
|
||||
|
||||
**Please note**: To allow JavaScript fetching the fulltext, the `CORS headers <https://en.wikipedia.org/wiki/Cross-origin_resource_sharing>`_ must be configured appropriate on the providing webserver.
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<label index="tt_content.pi_flexform.collections">Restrict search to these collections</label>
|
||||
<label index="tt_content.pi_flexform.searchIn">Restrict search to current document or collection?</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.none">none</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.document">document only</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.document">document only (incl. subordinates)</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.collection">collection only</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.all">both</label>
|
||||
<label index="tt_content.pi_flexform.facets">Show these facets</label>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<label index="tt_content.pi_flexform.collections">Suche auf diese Kollektionen einschränken</label>
|
||||
<label index="tt_content.pi_flexform.searchIn">Suche auf aktuelle/s Kollektion/Dokument einschränken?</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.none">nein</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.document">nur Dokument</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.document">nur Dokument (inkl. Unterordnungen)</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.collection">nur Kollektion</label>
|
||||
<label index="tt_content.pi_flexform.searchIn.all">beides</label>
|
||||
<label index="tt_content.pi_flexform.facets">Diese Facetten anzeigen</label>
|
||||
|
|
|
@ -57,7 +57,13 @@ var dlfViewerFullTextControl = function(map, image, fulltextUrl) {
|
|||
*/
|
||||
this.dic = $('#tx-dlf-tools-fulltext').length > 0 && $('#tx-dlf-tools-fulltext').attr('data-dic') ?
|
||||
dlfUtils.parseDataDic($('#tx-dlf-tools-fulltext')) :
|
||||
{'fulltext':'Fulltext', 'fulltext-on':'Activate Fulltext','fulltext-off':'Deactivate Fulltext', 'activate-full-text-initially':'0', 'full-text-scroll-element':'html, body'};
|
||||
{
|
||||
'fulltext':'Fulltext',
|
||||
'fulltext-on':'Activate Fulltext',
|
||||
'fulltext-off':'Deactivate Fulltext',
|
||||
'activate-full-text-initially':'0',
|
||||
'full-text-scroll-element':'html, body',
|
||||
'search-hl-parameters':'tx_dlf[highlight_word]'};
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
|
@ -71,6 +77,12 @@ var dlfViewerFullTextControl = function(map, image, fulltextUrl) {
|
|||
*/
|
||||
this.fullTextScrollElement = this.dic['full-text-scroll-element'];
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
this.searchHlParameters = this.dic['search-hl-parameters'];
|
||||
|
||||
/**
|
||||
* @type {ol.Feature|undefined}
|
||||
* @private
|
||||
|
|
|
@ -293,7 +293,7 @@ dlfViewerImageManipulationControl.prototype.createMap_ = function() {
|
|||
new ol.interaction.PinchZoom(),
|
||||
new ol.interaction.MouseWheelZoom(),
|
||||
new ol.interaction.KeyboardPan(),
|
||||
new ol.interaction.KeyboardZoom,
|
||||
new ol.interaction.KeyboardZoom(),
|
||||
new ol.interaction.DragRotateAndZoom()
|
||||
],
|
||||
// necessary for proper working of the keyboard events
|
||||
|
|
|
@ -73,6 +73,12 @@ var dlfViewer = function(settings){
|
|||
*/
|
||||
this.highlightFieldParams = undefined;
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.highlightKeys = undefined;
|
||||
|
||||
/**
|
||||
* @type {Object|undefined}
|
||||
* @private
|
||||
|
@ -149,7 +155,7 @@ var dlfViewer = function(settings){
|
|||
*
|
||||
* @param {Array.<string>} controlNames
|
||||
*/
|
||||
dlfViewer.prototype.addCustomControls = function(controlNames) {
|
||||
dlfViewer.prototype.addCustomControls = function() {
|
||||
var fulltextControl = undefined,
|
||||
fulltextDownloadControl = undefined,
|
||||
annotationControl = undefined,
|
||||
|
@ -161,6 +167,7 @@ dlfViewer.prototype.addCustomControls = function(controlNames) {
|
|||
if (this.fulltexts[0] !== undefined && this.fulltexts[0].length !== 0 && this.fulltexts[0].url !== '' && this.images.length === 1) {
|
||||
fulltextControl = new dlfViewerFullTextControl(this.map, this.images[0], this.fulltexts[0].url);
|
||||
fulltextDownloadControl = new dlfViewerFullTextDownloadControl(this.map, this.images[0], this.fulltexts[0].url);
|
||||
this.highlightKeys = fulltextControl.searchHlParameters;
|
||||
} else {
|
||||
$('#tx-dlf-tools-fulltext').remove();
|
||||
}
|
||||
|
@ -280,7 +287,7 @@ dlfViewer.prototype.createControls_ = function(controlNames, layers) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Displayes highlight words
|
||||
* Displays highlight words
|
||||
*/
|
||||
dlfViewer.prototype.displayHighlightWord = function() {
|
||||
|
||||
|
@ -322,12 +329,24 @@ dlfViewer.prototype.displayHighlightWord = function() {
|
|||
}
|
||||
}
|
||||
|
||||
// check keys for which highlighting should be made
|
||||
var keys = this.highlightKeys.split(',');
|
||||
// check if highlight by words is set
|
||||
var key = 'tx_dlf[highlight_word]',
|
||||
urlParams = dlfUtils.getUrlParams();
|
||||
var urlParams = dlfUtils.getUrlParams();
|
||||
|
||||
if (urlParams !== undefined && urlParams.hasOwnProperty(key) && this.fulltexts[0] !== undefined && this.fulltexts[0].url !== '' && this.images.length > 0) {
|
||||
var value = urlParams[key],
|
||||
var hasOwnProperty = false;
|
||||
var param = '';
|
||||
|
||||
for(let key of keys) {
|
||||
if(urlParams !== undefined && urlParams.hasOwnProperty(key.trim())) {
|
||||
hasOwnProperty = true;
|
||||
param = key.trim();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if (hasOwnProperty && this.fulltexts[0] !== undefined && this.fulltexts[0].url !== '' && this.images.length > 0) {
|
||||
var value = urlParams[param],
|
||||
values = value.split(';'),
|
||||
fulltextData = dlfFullTextUtils.fetchFullTextDataFromServer(this.fulltexts[0].url, this.images[0]),
|
||||
fulltextDataImageTwo = undefined;
|
||||
|
@ -397,7 +416,7 @@ dlfViewer.prototype.init = function(controlNames) {
|
|||
new ol.interaction.PinchZoom(),
|
||||
new ol.interaction.MouseWheelZoom(),
|
||||
new ol.interaction.KeyboardPan(),
|
||||
new ol.interaction.KeyboardZoom,
|
||||
new ol.interaction.KeyboardZoom(),
|
||||
new ol.interaction.DragRotateAndZoom()
|
||||
],
|
||||
// necessary for proper working of the keyboard events
|
||||
|
@ -418,11 +437,11 @@ dlfViewer.prototype.init = function(controlNames) {
|
|||
}
|
||||
}
|
||||
|
||||
this.addCustomControls();
|
||||
|
||||
// highlight word in case a highlight field is registered
|
||||
this.displayHighlightWord();
|
||||
|
||||
this.addCustomControls(controls);
|
||||
|
||||
// trigger event after all has been initialize
|
||||
$(window).trigger("map-loadend", window);
|
||||
|
||||
|
|
Loading…
Reference in New Issue