Skip to content

Commit

Permalink
solr proxy is running
Browse files Browse the repository at this point in the history
  • Loading branch information
Schleevoigt committed Nov 26, 2019
1 parent 98b8ed3 commit 9d8c53e
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 24 deletions.
16 changes: 10 additions & 6 deletions Classes/Utility/Ajax/GetOpenGraph.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<?php

namespace Subhh\Hosfindfacetviews\Utility\OpenGraph;
namespace Subhh\Hosfindfacetviews\Utility\Ajax;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Utility\EidUtility;
use Vendor\Hosfindfacetviews\Utility\OpenGraph;

$og = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Subhh\\Hosfindfacetviews\\Utility\\OpenGraph\\OpenGraphLib');
$graph = $og::fetch(GeneralUtility::_GET('site'));
return json_encode($graph);

$og = GeneralUtility::makeInstance('Subhh\Hosfindfacetviews\Utility\OpenGraph\OpenGraph');
$og->main();

class GetOpenGraph {
function main(){
$graph = $og::fetch(GeneralUtility::_GET('site'));
return json_encode($graph);
}
}
?>
74 changes: 74 additions & 0 deletions Classes/Utility/Ajax/GetSolr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/* * *************************************************************
* Copyright notice
*
* (c) 2019 Rainer Schleevoigt <[email protected]>
* Hamburg State and University Library
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
* ************************************************************* */
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Utility\EidUtility;


function getOptionsFromTS() {
/** @var TypoScriptFrontendController $tsfc */
$tsfc = GeneralUtility::makeInstance(
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController',
$GLOBALS['TYPO3_CONF_VARS'],
GeneralUtility::_GET('id') ? : 1,
0,
true
);
$GLOBALS['TSFE'] = $tsfc;
$tsfc->fe_user = EidUtility::initFeUser();
$tsfc->determineId();
//$tsfc->getCompressedTCarray();
$tsfc->initTemplate();
$tsfc->getConfigArray();

/** @var TypoScriptService $typoScriptService */
$typoScriptService = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
try {
$typoscriptArray = $tsfc->tmpl->setup['plugin.']['tx_find.']['settings.']['connections.']['default.']['options.'];
$token = $typoScriptService->convertTypoScriptArrayToPlainArray($typoscriptArray);
return $token;
} catch (Exception $e) {
error_log("Missing TS parameter `plugin.tx_find.settings.connections.options`");
return "";
}
return "";
}

$opts = getOptionsFromTS();
$action= 'select';
$ACTIONS = ['select','suggest','query','browse','spell','tvrh','elevate','terms'];


$params = 'q=*:*';
foreach ($ACTIONS as $action) {
$params = GeneralUtility::_GET($action);
if ($params) {
$url = $opts['scheme']. '://'.$opts['host'] .':' .$opts['port'] . $opts['path'] . '/'
. $action . '?'. urldecode($params);
header('Content-type: application/json');
// echo $url;
system('wget -qO- \''. $url.'\'');
}
}
14 changes: 0 additions & 14 deletions Configuration/TypoScript/Project/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ plugin.tx_find.settings.facets.heatmap.tileprovider.crs = EPSG:3857
config.tx_realurl_enable = 1
config.absRefPrefix = /

plugin.tx_scriptmerger {
javascript {
compress.enable = 0
minify.enable = 0
merge.enable = 1
parseBody =1
}
css {
merge.enable = 1
compress.enable = 0
addContentInDocument = 0
}
}

tx_find_page = PAGE
tx_find_page {
typeNum < plugin.tx_find.settings.ajax.autocomplete
Expand Down
4 changes: 0 additions & 4 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ plugin.tx_find {

page = PAGE
page {
includeJS {
10=https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js
10.external=1
}
includeJSFooter {

13=EXT:hosfindfacetviews/Resources/Public/Javascript/vendor/jQuery.AutoLink.js
Expand Down
2 changes: 2 additions & 0 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['detail'] = 'EXT:'. $_EXTKEY.'/Classes/Utility/Ajax/Detail.php';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['wms'] = 'EXT:'. $_EXTKEY.'/Classes/Utility/Ajax/GetWMS.php';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['thumbnail'] = 'EXT:'. $_EXTKEY.'/Classes/Utility/Ajax/Thumbnail.php';
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['solr'] = 'EXT:'. $_EXTKEY.'/Classes/Utility/Ajax/GetSolr.php';

$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['og'] = 'EXT:'. $_EXTKEY.'/Classes/Utility/Ajax/GetOpenGraph.php';

$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
Expand Down

0 comments on commit 9d8c53e

Please sign in to comment.