-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1139 from NFDI4Chem/development
Development
- Loading branch information
Showing
26 changed files
with
1,251 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace App\Actions\Project; | ||
|
||
use App\Models\Dataset; | ||
use App\Models\Project; | ||
use App\Models\Study; | ||
use App\Services\DOI\DOIService; | ||
use Illuminate\Support\Collection; | ||
|
||
class UpdateDOI | ||
{ | ||
private $doiService; | ||
|
||
/** | ||
* Create a new class instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(DOIService $doiService) | ||
{ | ||
$this->doiService = $doiService; | ||
} | ||
|
||
/** | ||
* Update the given model DOI metadata. | ||
* | ||
* @param mixed $model | ||
* @return void | ||
*/ | ||
public function update($model) | ||
{ | ||
$project = null; | ||
$studies = null; | ||
if ($model instanceof Project) { | ||
$project = $model; | ||
} elseif ($model instanceof Collection) { | ||
$studies = $model; | ||
} | ||
|
||
if ($project) { | ||
$project->addRelatedIdentifiers($this->doiService); | ||
$studies = $project->studies; | ||
} | ||
if ($studies) { | ||
foreach ($studies as $study) { | ||
if ($study instanceof Study) { | ||
$study->addRelatedIdentifiers($this->doiService); | ||
$datasets = $study->datasets; | ||
foreach ($datasets as $dataset) { | ||
if ($dataset instanceof Dataset) { | ||
$dataset->addRelatedIdentifiers($this->doiService); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/Http/Controllers/API/Schemas/DataCite/DOIController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\API\Schemas\DataCite; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Services\DOI\DOIService; | ||
use Illuminate\Http\Request; | ||
|
||
class DOIController extends Controller | ||
{ | ||
/** | ||
* Create a new class instance. | ||
* | ||
* @param App\Services\DOI\DOIService $doiService | ||
* @return void | ||
*/ | ||
public function __construct(DOIService $doiService) | ||
{ | ||
$this->doiService = $doiService; | ||
} | ||
|
||
/** | ||
* Update Model's DataCite metadata | ||
* | ||
* @param Illuminate\Http\Request $request | ||
* @param string $identifier | ||
* @return void | ||
*/ | ||
public function update(Request $request, $identifier) | ||
{ | ||
$resolvedModel = resolveIdentifier($identifier); | ||
$model = $resolvedModel['model']; | ||
|
||
// Call the updateDOI function | ||
$model->updateDOIMetadata($this->doiService); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.