-
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 branch 'development' of https://github.com/NFDI4Chem/nmrxiv int…
…o issue-#601
- Loading branch information
Showing
115 changed files
with
8,742 additions
and
1,862 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Actions\Study; | ||
|
||
use App\Models\Study; | ||
|
||
class PublishStudy | ||
{ | ||
/** | ||
* Publish the given study. | ||
* | ||
* @param mixed $study | ||
* @return void | ||
*/ | ||
public function publish($study) | ||
{ | ||
$study->is_public = true; | ||
$study->save(); | ||
$datasets = $study->datasets; | ||
foreach ($datasets as $dataset) { | ||
$dataset->is_public = true; | ||
$dataset->save(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Jobs\ArchiveProject; | ||
use App\Jobs\ArchiveStudy; | ||
use App\Models\Project; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class ArchiveData extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'nmrxiv:archive-data'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
return DB::transaction(function () { | ||
$projects = Project::where([ | ||
['is_public', true], | ||
['download_url', null], | ||
])->get(); | ||
|
||
foreach ($projects as $project) { | ||
echo $project->identifier; | ||
echo "\r\n"; | ||
ArchiveProject::dispatch($project); | ||
ArchiveStudy::dispatch($project); | ||
} | ||
}); | ||
} | ||
} |
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
Oops, something went wrong.