diff --git a/app/Console/Commands/UpdateSolrDataset.php b/app/Console/Commands/UpdateSolrDataset.php new file mode 100644 index 0000000..e5fb097 --- /dev/null +++ b/app/Console/Commands/UpdateSolrDataset.php @@ -0,0 +1,55 @@ +argument('dataset'); + $dataset = Dataset::find($datasetId); + // $this->info($dataset->authors->implode('full_name', ', ')); + + try { + // Opus_Search_Service::selectIndexingService('onDocumentChange') + $service = new SolariumAdapter("solr", config('solarium')); + $service->addDatasetsToIndex($dataset); + } catch (Exception $e) { + $this->error(__METHOD__ . ': ' . 'Indexing document ' . $dataset->id . ' failed: ' . $e->getMessage()); + } + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bcdf533..2e482ee 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -15,7 +15,8 @@ class Kernel extends ConsoleKernel 'App\Console\Commands\Inspire', 'App\Console\Commands\DatasetState', 'App\Console\Commands\SolrIndexBuilder', - 'App\Console\Commands\Log\ClearLogFile' + 'App\Console\Commands\Log\ClearLogFile', + 'App\Console\Commands\UpdateSolrDataset' ]; /** diff --git a/app/Library/Search/SolariumAdapter.php b/app/Library/Search/SolariumAdapter.php index 1066715..5287cbe 100644 --- a/app/Library/Search/SolariumAdapter.php +++ b/app/Library/Search/SolariumAdapter.php @@ -95,7 +95,7 @@ class SolariumAdapter foreach ($documents as $document) { if (!($document instanceof Dataset)) { - throw new InvalidArgumentException("invalid dataset in provided set"); + throw new \InvalidArgumentException("invalid dataset in provided set"); } } diff --git a/app/Library/Xml/DatasetExtension.php b/app/Library/Xml/DatasetExtension.php index db9f238..39ef043 100644 --- a/app/Library/Xml/DatasetExtension.php +++ b/app/Library/Xml/DatasetExtension.php @@ -50,7 +50,7 @@ trait DatasetExtension 'PersonAuthor' => array( 'model' => Person::class, 'through' => 'link_documents_persons', - 'pivot' => array('role' => 'author'), + 'pivot' => array('role' => 'author', 'sort_order' => 'sort_order'), //'sort_order' => array('sort_order' => 'ASC'), // <-- We need a sorted authors list. //'sort_field' => 'SortOrder', 'relation' => 'persons', @@ -59,7 +59,7 @@ trait DatasetExtension 'PersonContributor' => array( 'model' => Person::class, 'through' => 'link_documents_persons', - 'pivot' => array('role' => 'contributor', 'contributor_type' => 'contributor_type'), + 'pivot' => array('role' => 'contributor', 'contributor_type' => 'contributor_type', 'sort_order' => 'sort_order'), // 'sort_order' => array('sort_order' => 'ASC'), // <-- We need a sorted authors list. //'sort_field' => 'SortOrder', 'relation' => 'persons', diff --git a/app/Listeners/DatasetUpdated.php b/app/Listeners/DatasetUpdated.php index 4b7f58e..e45943d 100644 --- a/app/Listeners/DatasetUpdated.php +++ b/app/Listeners/DatasetUpdated.php @@ -60,7 +60,7 @@ class DatasetUpdated $service = new SolariumAdapter("solr", config('solarium')); $service->addDatasetsToIndex($dataset); } catch (Opus_Search_Exception $e) { - Log::debug(__METHOD__ . ': ' . 'Indexing document ' . $documentId . ' failed: ' . $e->getMessage()); + Log::debug(__METHOD__ . ': ' . 'Indexing document ' . $dataset->id . ' failed: ' . $e->getMessage()); } catch (InvalidArgumentException $e) { Log::warning(__METHOD__ . ': ' . $e->getMessage()); } diff --git a/composer.lock b/composer.lock index 75ed9b8..74b7be2 100755 --- a/composer.lock +++ b/composer.lock @@ -451,16 +451,16 @@ }, { "name": "egulias/email-validator", - "version": "2.1.21", + "version": "2.1.22", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "563d0cdde5d862235ffe24a158497f4d490191b5" + "reference": "68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/563d0cdde5d862235ffe24a158497f4d490191b5", - "reference": "563d0cdde5d862235ffe24a158497f4d490191b5", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5", + "reference": "68e418ec08fbfc6f58f6fd2eea70ca8efc8cc7d5", "shasum": "" }, "require": { @@ -505,7 +505,7 @@ "validation", "validator" ], - "time": "2020-09-19T14:37:56+00:00" + "time": "2020-09-26T15:48:38+00:00" }, { "name": "facade/ignition-contracts", @@ -1213,16 +1213,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "fda190b62b962d96a069fcc414d781db66d65b69" + "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/fda190b62b962d96a069fcc414d781db66d65b69", - "reference": "fda190b62b962d96a069fcc414d781db66d65b69", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28", + "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28", "shasum": "" }, "require": { @@ -1260,7 +1260,7 @@ "type": "tidelift" } ], - "time": "2020-08-09T10:34:01+00:00" + "time": "2020-09-21T18:10:53+00:00" }, { "name": "mcamara/laravel-localization", @@ -1427,16 +1427,16 @@ }, { "name": "nesbot/carbon", - "version": "2.40.0", + "version": "2.40.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "6c7646154181013ecd55e80c201b9fd873c6ee5d" + "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/6c7646154181013ecd55e80c201b9fd873c6ee5d", - "reference": "6c7646154181013ecd55e80c201b9fd873c6ee5d", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d9a76d8b7eb0f97cf3a82529393245212f40ba3b", + "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b", "shasum": "" }, "require": { @@ -1512,20 +1512,20 @@ "type": "tidelift" } ], - "time": "2020-09-11T19:00:58+00:00" + "time": "2020-09-23T08:17:37+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.0", + "version": "v4.10.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1c13d05035deff45f1230ca68bd7d74d621762d9" + "reference": "658f1be311a230e0907f5dfe0213742aff0596de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1c13d05035deff45f1230ca68bd7d74d621762d9", - "reference": "1c13d05035deff45f1230ca68bd7d74d621762d9", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", + "reference": "658f1be311a230e0907f5dfe0213742aff0596de", "shasum": "" }, "require": { @@ -1564,7 +1564,7 @@ "parser", "php" ], - "time": "2020-09-19T14:52:48+00:00" + "time": "2020-09-26T10:30:38+00:00" }, { "name": "opis/closure", @@ -2162,16 +2162,16 @@ }, { "name": "symfony/console", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b39fd99b9297b67fb7633b7d8083957a97e1e727" + "reference": "90933b39c7b312fc3ceaa1ddeac7eb48cb953124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b39fd99b9297b67fb7633b7d8083957a97e1e727", - "reference": "b39fd99b9297b67fb7633b7d8083957a97e1e727", + "url": "https://api.github.com/repos/symfony/console/zipball/90933b39c7b312fc3ceaa1ddeac7eb48cb953124", + "reference": "90933b39c7b312fc3ceaa1ddeac7eb48cb953124", "shasum": "" }, "require": { @@ -2249,11 +2249,11 @@ "type": "tidelift" } ], - "time": "2020-09-02T07:07:21+00:00" + "time": "2020-09-15T07:58:55+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.5", + "version": "v5.1.6", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2320,16 +2320,16 @@ }, { "name": "symfony/debug", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "aeb73aca16a8f1fe958230fe44e6cf4c84cbb85e" + "reference": "726b85e69342e767d60e3853b98559a68ff74183" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/aeb73aca16a8f1fe958230fe44e6cf4c84cbb85e", - "reference": "aeb73aca16a8f1fe958230fe44e6cf4c84cbb85e", + "url": "https://api.github.com/repos/symfony/debug/zipball/726b85e69342e767d60e3853b98559a68ff74183", + "reference": "726b85e69342e767d60e3853b98559a68ff74183", "shasum": "" }, "require": { @@ -2387,20 +2387,20 @@ "type": "tidelift" } ], - "time": "2020-08-10T07:47:39+00:00" + "time": "2020-09-09T05:20:36+00:00" }, { "name": "symfony/error-handler", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "2434fb32851f252e4f27691eee0b77c16198db62" + "reference": "5a6feca7a384015a09e14265c35ee0bd6f54b2ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/2434fb32851f252e4f27691eee0b77c16198db62", - "reference": "2434fb32851f252e4f27691eee0b77c16198db62", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/5a6feca7a384015a09e14265c35ee0bd6f54b2ed", + "reference": "5a6feca7a384015a09e14265c35ee0bd6f54b2ed", "shasum": "" }, "require": { @@ -2458,20 +2458,20 @@ "type": "tidelift" } ], - "time": "2020-08-17T09:56:45+00:00" + "time": "2020-09-25T08:51:35+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030" + "reference": "e17bb5e0663dc725f7cdcafc932132735b4725cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3e8ea5ccddd00556b86d69d42f99f1061a704030", - "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e17bb5e0663dc725f7cdcafc932132735b4725cd", + "reference": "e17bb5e0663dc725f7cdcafc932132735b4725cd", "shasum": "" }, "require": { @@ -2489,6 +2489,7 @@ "psr/log": "~1.0", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "~3.4|~4.4", "symfony/expression-language": "^3.4|^4.0|^5.0", "symfony/http-foundation": "^3.4|^4.0|^5.0", "symfony/service-contracts": "^1.1|^2", @@ -2542,7 +2543,7 @@ "type": "tidelift" } ], - "time": "2020-08-13T14:18:44+00:00" + "time": "2020-09-18T14:07:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2622,16 +2623,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2a78590b2c7e3de5c429628457c47541c58db9c7" + "reference": "5ef0f6c609c1a36f723880dfe78301199bc96868" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2a78590b2c7e3de5c429628457c47541c58db9c7", - "reference": "2a78590b2c7e3de5c429628457c47541c58db9c7", + "url": "https://api.github.com/repos/symfony/finder/zipball/5ef0f6c609c1a36f723880dfe78301199bc96868", + "reference": "5ef0f6c609c1a36f723880dfe78301199bc96868", "shasum": "" }, "require": { @@ -2681,20 +2682,95 @@ "type": "tidelift" } ], - "time": "2020-08-17T09:56:45+00:00" + "time": "2020-09-02T16:08:58+00:00" }, { - "name": "symfony/http-foundation", - "version": "v4.4.13", + "name": "symfony/http-client-contracts", + "version": "v2.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "e3e5a62a6631a461954d471e7206e3750dbe8ee1" + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "3a5d0fe7908daaa23e3dbf4cee3ba4bfbb19fdd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e3e5a62a6631a461954d471e7206e3750dbe8ee1", - "reference": "e3e5a62a6631a461954d471e7206e3750dbe8ee1", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/3a5d0fe7908daaa23e3dbf4cee3ba4bfbb19fdd3", + "reference": "3a5d0fe7908daaa23e3dbf4cee3ba4bfbb19fdd3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v4.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "ff509ca7a73641bdbd7b56169a9004e64a58451d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ff509ca7a73641bdbd7b56169a9004e64a58451d", + "reference": "ff509ca7a73641bdbd7b56169a9004e64a58451d", "shasum": "" }, "require": { @@ -2750,20 +2826,20 @@ "type": "tidelift" } ], - "time": "2020-08-17T07:39:58+00:00" + "time": "2020-09-13T05:00:26+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2bb7b90ecdc79813c0bf237b7ff20e79062b5188" + "reference": "e3eac6daeb0c65965a6201bd2de9564a802fe0a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2bb7b90ecdc79813c0bf237b7ff20e79062b5188", - "reference": "2bb7b90ecdc79813c0bf237b7ff20e79062b5188", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/e3eac6daeb0c65965a6201bd2de9564a802fe0a9", + "reference": "e3eac6daeb0c65965a6201bd2de9564a802fe0a9", "shasum": "" }, "require": { @@ -2771,6 +2847,7 @@ "psr/log": "~1.0", "symfony/error-handler": "^4.4", "symfony/event-dispatcher": "^4.4", + "symfony/http-client-contracts": "^1.1|^2", "symfony/http-foundation": "^4.4|^5.0", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9", @@ -2855,20 +2932,20 @@ "type": "tidelift" } ], - "time": "2020-09-02T08:09:29+00:00" + "time": "2020-09-27T04:25:44+00:00" }, { "name": "symfony/mime", - "version": "v5.1.5", + "version": "v5.1.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "89a2c9b4cb7b5aa516cf55f5194c384f444c81dc" + "reference": "4404d6545125863561721514ad9388db2661eec5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/89a2c9b4cb7b5aa516cf55f5194c384f444c81dc", - "reference": "89a2c9b4cb7b5aa516cf55f5194c384f444c81dc", + "url": "https://api.github.com/repos/symfony/mime/zipball/4404d6545125863561721514ad9388db2661eec5", + "reference": "4404d6545125863561721514ad9388db2661eec5", "shasum": "" }, "require": { @@ -2932,7 +3009,7 @@ "type": "tidelift" } ], - "time": "2020-08-17T10:01:29+00:00" + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3638,16 +3715,16 @@ }, { "name": "symfony/process", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "65e70bab62f3da7089a8d4591fb23fbacacb3479" + "reference": "9b887acc522935f77555ae8813495958c7771ba7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/65e70bab62f3da7089a8d4591fb23fbacacb3479", - "reference": "65e70bab62f3da7089a8d4591fb23fbacacb3479", + "url": "https://api.github.com/repos/symfony/process/zipball/9b887acc522935f77555ae8813495958c7771ba7", + "reference": "9b887acc522935f77555ae8813495958c7771ba7", "shasum": "" }, "require": { @@ -3697,20 +3774,20 @@ "type": "tidelift" } ], - "time": "2020-07-23T08:31:43+00:00" + "time": "2020-09-02T16:08:58+00:00" }, { "name": "symfony/routing", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "e3387963565da9bae51d1d3ab8041646cc93bd04" + "reference": "8db77d97152f55f0df5158cc0a877ad8e16099ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/e3387963565da9bae51d1d3ab8041646cc93bd04", - "reference": "e3387963565da9bae51d1d3ab8041646cc93bd04", + "url": "https://api.github.com/repos/symfony/routing/zipball/8db77d97152f55f0df5158cc0a877ad8e16099ac", + "reference": "8db77d97152f55f0df5158cc0a877ad8e16099ac", "shasum": "" }, "require": { @@ -3787,7 +3864,7 @@ "type": "tidelift" } ], - "time": "2020-08-10T07:27:51+00:00" + "time": "2020-09-02T16:08:58+00:00" }, { "name": "symfony/service-contracts", @@ -3867,16 +3944,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "700e6e50174b0cdcf0fa232773bec5c314680575" + "reference": "0b8c4bb49b05b11d2b9dd1732f26049b08d96884" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/700e6e50174b0cdcf0fa232773bec5c314680575", - "reference": "700e6e50174b0cdcf0fa232773bec5c314680575", + "url": "https://api.github.com/repos/symfony/translation/zipball/0b8c4bb49b05b11d2b9dd1732f26049b08d96884", + "reference": "0b8c4bb49b05b11d2b9dd1732f26049b08d96884", "shasum": "" }, "require": { @@ -3953,7 +4030,7 @@ "type": "tidelift" } ], - "time": "2020-08-17T09:56:45+00:00" + "time": "2020-09-24T09:40:01+00:00" }, { "name": "symfony/translation-contracts", @@ -4032,16 +4109,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.13", + "version": "v4.4.14", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "1bef32329f3166486ab7cb88599cae4875632b99" + "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1bef32329f3166486ab7cb88599cae4875632b99", - "reference": "1bef32329f3166486ab7cb88599cae4875632b99", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0dc22bdf9d1197467bb04d505355180b6f20bcca", + "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca", "shasum": "" }, "require": { @@ -4119,7 +4196,7 @@ "type": "tidelift" } ], - "time": "2020-08-17T07:31:35+00:00" + "time": "2020-09-18T08:35:10+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", diff --git a/public/solr.xslt b/public/solr.xslt index be47eeb..0e4d530 100644 --- a/public/solr.xslt +++ b/public/solr.xslt @@ -136,6 +136,7 @@ + author @@ -148,6 +149,7 @@ author_sort + diff --git a/solr.xslt b/solr.xslt index 5e6b65d..e050b22 100644 --- a/solr.xslt +++ b/solr.xslt @@ -134,8 +134,9 @@ - + + author @@ -148,6 +149,7 @@ author_sort +