diff --git a/app/Http/Controllers/Publish/EditorController.php b/app/Http/Controllers/Publish/EditorController.php index bc48c7a..e55271c 100644 --- a/app/Http/Controllers/Publish/EditorController.php +++ b/app/Http/Controllers/Publish/EditorController.php @@ -1,4 +1,5 @@ doiClient = $DoiClient; + //$this->middleware('auth'); + $this->xml = new \DomDocument(); + $this->proc = new \XSLTProcessor(); } /** @@ -48,11 +78,12 @@ class EditorController extends Controller $builder = Dataset::query(); //"select * from [documents] where [server_state] in (?) or ([server_state] = ? and [editor_id] = ?)" $datasets = $builder + ->where('server_state', 'released') // ->whereIn('server_state', ['released']) ->orWhere(function ($query) use ($user_id) { - $query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed']) - ->where('editor_id', $user_id); + $query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed', 'published']) + ->where('editor_id', $user_id)->doesntHave('identifier', 'and'); }) ->orderBy('server_date_modified', 'desc') ->get(); @@ -105,8 +136,10 @@ class EditorController extends Controller $dataset->load('licenses', 'authors', 'contributors', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references'); $titleTypes = ['Main' => 'Main', 'Sub' => 'Sub', 'Alternative' => 'Alternative', 'Translated' => 'Translated', 'Other' => 'Other']; - $descriptionTypes = ['Abstract' => 'Abstract', 'Methods' => 'Methods', 'Series_information' => 'Series_information', - 'Technical_info' => 'Technical_info', 'Translated' => 'Translated', 'Other' => 'Other']; + $descriptionTypes = [ + 'Abstract' => 'Abstract', 'Methods' => 'Methods', 'Series_information' => 'Series_information', + 'Technical_info' => 'Technical_info', 'Translated' => 'Translated', 'Other' => 'Other' + ]; $languages = DB::table('languages') ->where('active', true) ->pluck('part1', 'part1'); @@ -126,7 +159,7 @@ class EditorController extends Controller $languages = DB::table('languages') ->where('active', true) ->pluck('part1', 'part1'); - + $contributorTypes = Config::get('enums.contributor_types'); $nameTypes = Config::get('enums.name_types'); @@ -142,8 +175,10 @@ class EditorController extends Controller $referenceTypes = ["rdr-id", "doi", "handle", "isbn", "issn", "url", "urn"]; $referenceTypes = array_combine($referenceTypes, $referenceTypes); - $relationTypes = ["IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", - "IsNewVersionOf", "IsPartOf", "HasPart", "Compiles", "IsVariantFormOf"]; + $relationTypes = [ + "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", + "IsNewVersionOf", "IsPartOf", "HasPart", "Compiles", "IsVariantFormOf" + ]; $relationTypes = array_combine($relationTypes, $relationTypes); return View::make( @@ -415,7 +450,8 @@ class EditorController extends Controller $formCoverage ); } elseif (isset($data['coverage']) && $this->containsOnlyNull($data['coverage']) - && !is_null($dataset->coverage)) { + && !is_null($dataset->coverage) + ) { $dataset->coverage()->delete(); } @@ -592,4 +628,131 @@ class EditorController extends Controller } throw new GeneralException(trans('exceptions.publish.publish.update_error')); } + + /** + * Display the specified dataset for publishing. + * + * @param int $id + * @return \Illuminate\View\View + */ + public function doi($id): \Illuminate\Contracts\View\View + { + $dataset = Dataset::query() + ->with([ + 'titles', + 'persons' => function ($query) { + $query->wherePivot('role', 'author'); + }, + ])->findOrFail($id); + + return View::make('workflow.editor.doi', [ + 'dataset' => $dataset, + ]); + } + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function doiStore(Request $request, $publish_id) + { + $dataId = $publish_id; //$request->input('publish_id'); + // Setup stylesheet + $this->loadStyleSheet(public_path() . '/prefixes/doi_datacite.xslt'); + + // set timestamp + $date = new \DateTime(); + $unixTimestamp = $date->getTimestamp(); + $this->proc->setParameter('', 'unixTimestamp', $unixTimestamp); + + $prefix = ""; + $base_domain = ""; + $datacite_environment = config('tethys.datacite_environment'); + if ($datacite_environment == "debug") { + $prefix = config('tethys.datacite_test_prefix'); + $base_domain = config('tethys.test_base_domain'); + } elseif ($datacite_environment == "production") { + $prefix = config('tethys.datacite_prefix'); + $base_domain = config('tethys.base_domain'); + } + // $prefix = config('tethys.datacite_prefix'); + $this->proc->setParameter('', 'prefix', $prefix); + + $repIdentifier = "tethys"; + $this->proc->setParameter('', 'repIdentifier', $repIdentifier); + + $this->xml->appendChild($this->xml->createElement('Datasets')); + $dataset = Dataset::where('publish_id', '=', $dataId)->firstOrFail(); + if (is_null($dataset)) { + throw new OaiModelException('Dataset is not available for registering DOI!', OaiModelError::NORECORDSMATCH); + } + $dataset->fetchValues(); + $xmlModel = new \App\Library\Xml\XmlModel(); + $xmlModel->setModel($dataset); + $xmlModel->excludeEmptyFields(); + $cache = ($dataset->xmlCache) ? $dataset->xmlCache : new \App\Models\XmlCache(); + $xmlModel->setXmlCache($cache); + $domNode = $xmlModel->getDomDocument()->getElementsByTagName('Rdr_Dataset')->item(0); + $node = $this->xml->importNode($domNode, true); + $this->addSpecInformation($node, 'data-type:' . $dataset->type); + + $this->xml->documentElement->appendChild($node); + $xmlMeta = $this->proc->transformToXML($this->xml); + // Log::alert($xmlMeta); + //create doiValue and correspunfing landingpage of tehtys + $doiValue = $prefix . '/tethys.' . $dataset->publish_id; + // $appUrl = config('app.url'); + $landingPageUrl = $base_domain . "/dataset/" . $dataset->publish_id; + $response = $this->doiClient->registerDoi($doiValue, $xmlMeta, $landingPageUrl); + // if operation successful, store dataste identifier + if ($response->getStatusCode() == 201) { + $doi = new DatasetIdentifier(); + $doi['value'] = $doiValue; //$landingPageUrl; + $doi['dataset_id'] = $dataset->id; + $doi['type'] = "doi"; + $doi['status'] = "findable"; + if ($doi->save()) { + // update server_date_modified for triggering nex xml cache (doi interface) + $time = new \Illuminate\Support\Carbon(); + $dataset->server_date_modified = $time; + $dataset->save(); + return redirect() + ->route('publish.workflow.editor.index') + ->with('flash_message', 'You have successfully created a DOI for the dataset!'); + } + } else { + $message = 'unexpected DataCite MDS response code ' . $response->getStatusCode(); + // $this->log($message, 'err'); + throw new GeneralException($message); + } + } + + /** + * Load an xslt stylesheet. + * + * @return void + */ + private function loadStyleSheet($stylesheet) + { + $this->xslt = new \DomDocument; + $this->xslt->load($stylesheet); + $this->proc->importStyleSheet($this->xslt); + if (isset($_SERVER['HTTP_HOST'])) { + $this->proc->setParameter('', 'host', $_SERVER['HTTP_HOST']); + } + //$this->proc->setParameter('', 'server', $this->getRequest()->getBaseUrl()); + } + + private function addSpecInformation(\DOMNode $document, $information) + { + $setSpecAttribute = $this->xml->createAttribute('Value'); + $setSpecAttributeValue = $this->xml->createTextNode($information); + $setSpecAttribute->appendChild($setSpecAttributeValue); + + $setSpecElement = $this->xml->createElement('SetSpec'); + //$setSpecElement =new \DOMElement("SetSpec"); + $setSpecElement->appendChild($setSpecAttribute); + $document->appendChild($setSpecElement); + } } diff --git a/app/Library/Xml/DatasetExtension.php b/app/Library/Xml/DatasetExtension.php index 39ef043..317e151 100644 --- a/app/Library/Xml/DatasetExtension.php +++ b/app/Library/Xml/DatasetExtension.php @@ -7,6 +7,7 @@ use App\Models\License; use App\Models\Person; use App\Models\File; use App\Models\Coverage; +use App\Models\DatasetIdentifier; use App\Models\Subject; use App\Models\DatasetReference; @@ -70,6 +71,11 @@ trait DatasetExtension 'relation' => 'references', 'fetch' => 'eager' ), + 'Identifier' => array( + 'model' => DatasetIdentifier::class, + 'relation' => 'identifier', + 'fetch' => 'eager' + ), 'Subject' => array( 'model' => Subject::class, 'relation' => 'subjects', diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index b53ebc1..e465884 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -13,6 +13,7 @@ use App\Models\Project; use App\Models\Title; use App\Models\User; use App\Models\XmlCache; +use App\Models\DatasetIdentifier; use Carbon\Carbon; // use App\Models\GeolocationBox; use Illuminate\Database\Eloquent\Model; @@ -96,6 +97,14 @@ class Dataset extends Model return $this->belongsTo(Project::class, 'project_id', 'id'); } + /** + * Get the doi indentifier that owns the dataset. + */ + public function identifier() + { + return $this->hasOne(DatasetIdentifier::class, 'dataset_id', 'id'); + } + /** * Get the account that the dataset belongs to */ diff --git a/app/Models/DatasetIdentifier.php b/app/Models/DatasetIdentifier.php index bde87bf..9f0c079 100644 --- a/app/Models/DatasetIdentifier.php +++ b/app/Models/DatasetIdentifier.php @@ -14,6 +14,6 @@ class DatasetIdentifier extends Model */ public function dataset() { - return $this->belongsTo(Dataset::class, 'document_id', 'id'); + return $this->belongsTo(Dataset::class, 'dataset_id', 'id'); } } diff --git a/app/Providers/DoiServiceProvider.php b/app/Providers/DoiServiceProvider.php index 94de187..8a4775d 100644 --- a/app/Providers/DoiServiceProvider.php +++ b/app/Providers/DoiServiceProvider.php @@ -7,7 +7,8 @@ namespace App\Providers; -use App\Tethys\Utils\DoiService; +use App\Tethys\Utils\DoiClient; +use App\Interfaces\DoiInterface; use Illuminate\Support\ServiceProvider; class DoiServiceProvider extends ServiceProvider @@ -33,12 +34,12 @@ class DoiServiceProvider extends ServiceProvider { // $this->app->singleton('App\Interfaces\DoiInterface', function ($app) { - return new DoiService(); + return new DoiClient(); }); } public function provides() { - return [DoiService::class]; + return [DoiClient::class]; } } diff --git a/app/Tethys/Utils/DoiClient.php b/app/Tethys/Utils/DoiClient.php index 45e12e2..933e2b9 100644 --- a/app/Tethys/Utils/DoiClient.php +++ b/app/Tethys/Utils/DoiClient.php @@ -10,20 +10,24 @@ class DoiClient implements DoiInterface private $username; private $password; private $serviceUrl; + private $prefix; + private $base_domain; public function __construct() { - $datacite_environment = "production"; //config('tethys.datacite_environment'); + $datacite_environment = config('tethys.datacite_environment'); if ($datacite_environment == "debug") { $this->username = config('tethys.datacite_test_username'); $this->password = config('tethys.datacite_test_password'); - $this->serviceUrl = config('tethys.test_datacite_service_url'); - $this->prefix = config('tethys.datacite_prefix'); + $this->serviceUrl = config('tethys.datacite_test_service_url'); + $this->prefix = config('tethys.datacite_test_prefix'); + $this->base_domain = config('tethys.test_base_domain'); } elseif ($datacite_environment == "production") { $this->username = config('tethys.datacite_username'); $this->password = config('tethys.datacite_password'); $this->serviceUrl = config('tethys.datacite_service_url'); $this->prefix = config('tethys.datacite_prefix'); + $this->base_domain = config('tethys.base_domain'); } if (is_null($this->username) || is_null($this->password) || is_null($this->serviceUrl)) { $message = 'missing configuration settings to properly initialize DOI client'; @@ -45,6 +49,7 @@ class DoiClient implements DoiInterface { // Schritt 1: Metadaten als XML registrieren + // state draft $response = null; $url = $this->serviceUrl . '/metadata/' . $doiValue; try { @@ -79,7 +84,7 @@ class DoiClient implements DoiInterface } // Schritt 2: Register the DOI name - // DOI und URL der Frontdoor des zugehörigen Dokuments übergeben + // DOI und URL der Frontdoor des zugehörigen Dokuments übergeben: state findable $url = $this->serviceUrl . '/doi/' . $doiValue; try { $client = new Client( @@ -199,7 +204,7 @@ class DoiClient implements DoiInterface public function updateMetadataForDoi($doiValue, $newMeta) { $response = null; - $url = $this->serviceUrl . '/metadata/' . $doiValue; + $url = $this->serviceUrl . '/metadata/' . $doiValue; try { $client = new Client([ 'auth' => [$this->username, $this->password], diff --git a/composer.lock b/composer.lock index 68ab689..c5ffb87 100755 --- a/composer.lock +++ b/composer.lock @@ -1359,16 +1359,16 @@ }, { "name": "laravel/framework", - "version": "v6.20.26", + "version": "v6.20.27", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "0117d797dc1ab64b1f88d4f6b966380ea7def091" + "reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/0117d797dc1ab64b1f88d4f6b966380ea7def091", - "reference": "0117d797dc1ab64b1f88d4f6b966380ea7def091", + "url": "https://api.github.com/repos/laravel/framework/zipball/92c0417e60efc39bc556ba5dfc9b20a56f7848fb", + "reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb", "shasum": "" }, "require": { @@ -1508,7 +1508,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-04-28T14:38:32+00:00" + "time": "2021-05-11T14:00:28+00:00" }, { "name": "laravel/tinker", @@ -1652,16 +1652,16 @@ }, { "name": "league/commonmark", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "2651c497f005de305c7ba3f232cbd87b8c00ee8c" + "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2651c497f005de305c7ba3f232cbd87b8c00ee8c", - "reference": "2651c497f005de305c7ba3f232cbd87b8c00ee8c", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb", + "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb", "shasum": "" }, "require": { @@ -1749,7 +1749,7 @@ "type": "tidelift" } ], - "time": "2021-05-08T16:08:00+00:00" + "time": "2021-05-12T11:39:41+00:00" }, { "name": "league/flysystem", @@ -2076,16 +2076,16 @@ }, { "name": "nesbot/carbon", - "version": "2.47.0", + "version": "2.48.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "606262fd8888b75317ba9461825a24fc34001e1e" + "reference": "d3c447f21072766cddec3522f9468a5849a76147" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/606262fd8888b75317ba9461825a24fc34001e1e", - "reference": "606262fd8888b75317ba9461825a24fc34001e1e", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3c447f21072766cddec3522f9468a5849a76147", + "reference": "d3c447f21072766cddec3522f9468a5849a76147", "shasum": "" }, "require": { @@ -2165,7 +2165,7 @@ "type": "tidelift" } ], - "time": "2021-04-13T21:54:02+00:00" + "time": "2021-05-07T10:08:30+00:00" }, { "name": "nikic/php-parser", @@ -3016,16 +3016,16 @@ }, { "name": "symfony/console", - "version": "v4.4.22", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625" + "reference": "1ab187ac21d41d7d34a4f529091a1f5d0bb2924f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625", - "reference": "36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625", + "url": "https://api.github.com/repos/symfony/console/zipball/1ab187ac21d41d7d34a4f529091a1f5d0bb2924f", + "reference": "1ab187ac21d41d7d34a4f529091a1f5d0bb2924f", "shasum": "" }, "require": { @@ -3085,7 +3085,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.22" + "source": "https://github.com/symfony/console/tree/v4.4.23" }, "funding": [ { @@ -3101,7 +3101,7 @@ "type": "tidelift" } ], - "time": "2021-04-16T17:32:19+00:00" + "time": "2021-05-10T12:53:15+00:00" }, { "name": "symfony/css-selector", @@ -3306,16 +3306,16 @@ }, { "name": "symfony/error-handler", - "version": "v4.4.22", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "76603a8df8e001436df80758eb03a8baa5324175" + "reference": "21d75bfbdfdd3581a7f97080deb98926987f14a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/76603a8df8e001436df80758eb03a8baa5324175", - "reference": "76603a8df8e001436df80758eb03a8baa5324175", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/21d75bfbdfdd3581a7f97080deb98926987f14a7", + "reference": "21d75bfbdfdd3581a7f97080deb98926987f14a7", "shasum": "" }, "require": { @@ -3355,7 +3355,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v4.4.22" + "source": "https://github.com/symfony/error-handler/tree/v4.4.23" }, "funding": [ { @@ -3371,7 +3371,7 @@ "type": "tidelift" } ], - "time": "2021-04-02T07:50:12+00:00" + "time": "2021-05-02T20:47:26+00:00" }, { "name": "symfony/event-dispatcher", @@ -3537,16 +3537,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.20", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2543795ab1570df588b9bbd31e1a2bd7037b94f6" + "reference": "67b77716f517e3f864759232e1201e7aa2ab0e82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2543795ab1570df588b9bbd31e1a2bd7037b94f6", - "reference": "2543795ab1570df588b9bbd31e1a2bd7037b94f6", + "url": "https://api.github.com/repos/symfony/finder/zipball/67b77716f517e3f864759232e1201e7aa2ab0e82", + "reference": "67b77716f517e3f864759232e1201e7aa2ab0e82", "shasum": "" }, "require": { @@ -3578,7 +3578,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.20" + "source": "https://github.com/symfony/finder/tree/v4.4.23" }, "funding": [ { @@ -3594,7 +3594,7 @@ "type": "tidelift" } ], - "time": "2021-02-12T10:48:09+00:00" + "time": "2021-05-09T09:13:09+00:00" }, { "name": "symfony/http-client-contracts", @@ -3676,16 +3676,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.22", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "1a6f87ef99d05b1bf5c865b4ef7992263e1cb081" + "reference": "2ffb43bd6c589a274ee1e93a5fd6b7ef1577b9c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1a6f87ef99d05b1bf5c865b4ef7992263e1cb081", - "reference": "1a6f87ef99d05b1bf5c865b4ef7992263e1cb081", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/2ffb43bd6c589a274ee1e93a5fd6b7ef1577b9c5", + "reference": "2ffb43bd6c589a274ee1e93a5fd6b7ef1577b9c5", "shasum": "" }, "require": { @@ -3724,7 +3724,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v4.4.22" + "source": "https://github.com/symfony/http-foundation/tree/v4.4.23" }, "funding": [ { @@ -3740,20 +3740,20 @@ "type": "tidelift" } ], - "time": "2021-04-30T12:05:50+00:00" + "time": "2021-05-05T07:40:41+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.22", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f" + "reference": "95bb42312503a212f4467529bac8735f01226ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f", - "reference": "cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/95bb42312503a212f4467529bac8735f01226ff9", + "reference": "95bb42312503a212f4467529bac8735f01226ff9", "shasum": "" }, "require": { @@ -3828,7 +3828,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v4.4.22" + "source": "https://github.com/symfony/http-kernel/tree/v4.4.23" }, "funding": [ { @@ -3844,7 +3844,7 @@ "type": "tidelift" } ], - "time": "2021-05-01T14:38:48+00:00" + "time": "2021-05-12T13:13:32+00:00" }, { "name": "symfony/mime", @@ -4807,16 +4807,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.21", + "version": "v4.4.23", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "eb8f5428cc3b40d6dffe303b195b084f1c5fbd14" + "reference": "ff6e63c7b5de874464642969968f61f8dc649ac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/eb8f5428cc3b40d6dffe303b195b084f1c5fbd14", - "reference": "eb8f5428cc3b40d6dffe303b195b084f1c5fbd14", + "url": "https://api.github.com/repos/symfony/translation/zipball/ff6e63c7b5de874464642969968f61f8dc649ac3", + "reference": "ff6e63c7b5de874464642969968f61f8dc649ac3", "shasum": "" }, "require": { @@ -4875,7 +4875,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.21" + "source": "https://github.com/symfony/translation/tree/v4.4.23" }, "funding": [ { @@ -4891,7 +4891,7 @@ "type": "tidelift" } ], - "time": "2021-03-23T16:25:01+00:00" + "time": "2021-04-28T06:59:52+00:00" }, { "name": "symfony/translation-contracts", diff --git a/config/tethys.php b/config/tethys.php index 32ee19a..eb27945 100644 --- a/config/tethys.php +++ b/config/tethys.php @@ -2,12 +2,21 @@ return [ 'repoid' => 3156505, 'ccBaseuri' => 'https://creativecommons.org/licenses/|/3.0/', + + 'datacite_environment' => env('DATACITE_ENVIRONMENT'), + 'datacite_username' => env('DATACITE_USERNAME'), - // 'datacite_test_username' => env('DATACITE_TEST_USERNAME'), + 'datacite_test_username' => env('DATACITE_TEST_USERNAME'), + 'datacite_password' => env('DATACITE_PASSWORD'), - // 'datacite_test_password' => env('DATACITE_TEST_PASSWORD'), - 'datacite_service_url' => env('DATACITE_SERVICE_URL'), - // 'datacite_test_service_url' => env('DATACITE_TEST_SERVICE_URL'), + 'datacite_test_password' => env('DATACITE_TEST_PASSWORD'), + 'datacite_prefix' => env('DATACITE_PREFIX'), - 'base_domain' => 'https://www.tethys.at/', + 'datacite_test_prefix' => env('DATACITE_TEST_PREFIX'), + + 'datacite_service_url' => env('DATACITE_SERVICE_URL'), + 'datacite_test_service_url' => env('DATACITE_TEST_SERVICE_URL'), + + 'base_domain' => env('BASE_DOMAIN', 'https://tethys.at'), + 'test_base_domain' => env('TEST_BASE_DOMAIN') ]; diff --git a/doi_notes.txt b/doi_notes.txt index 5f7000c..05e63b7 100644 --- a/doi_notes.txt +++ b/doi_notes.txt @@ -7,4 +7,14 @@ php artisan make:controller DOIController --resource --model "Models\DatasetIden composer require guzzlehttp/guzzle -php artisan make:migration create_dataset_identifiers_table --table="dataset_identifiers" \ No newline at end of file +php artisan make:migration create_dataset_identifiers_table --table="dataset_identifiers" + + +make php unit tests: +php artisan test --testsuite=Feature +via composer: +composer test + + +siehe https://doi.datacite.org/repositories/tuw.tethys/dois (angemeldet) +e.g. https://doi.org/10.24341/tethys.1 \ No newline at end of file diff --git a/public/prefixes/oai_datacite.xslt b/public/prefixes/oai_datacite.xslt index ea18e99..9483221 100644 --- a/public/prefixes/oai_datacite.xslt +++ b/public/prefixes/oai_datacite.xslt @@ -28,27 +28,35 @@ * xml as required by the OAI-PMH protocol. */ --> - - - - oai: - - : - - + + + + + + + oai: + + : + + + + + @@ -122,7 +130,7 @@ - @@ -148,7 +156,7 @@ - @@ -168,7 +176,7 @@ - @@ -182,7 +190,7 @@ - @@ -196,8 +204,15 @@ + + + + + + - <xsl:if test="@Language != ''"> @@ -213,7 +228,7 @@ <xsl:value-of select="@Value"/> - <xsl:if test="@Language != ''"> @@ -230,7 +245,7 @@ - @@ -242,18 +257,18 @@ - url - + - @@ -266,7 +281,7 @@ - @@ -285,7 +300,7 @@ - @@ -323,14 +338,14 @@ - - diff --git a/resources/views/frontend/dataset/show.blade.php b/resources/views/frontend/dataset/show.blade.php index cc67c00..39d6295 100644 --- a/resources/views/frontend/dataset/show.blade.php +++ b/resources/views/frontend/dataset/show.blade.php @@ -42,6 +42,12 @@