-
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 'main' of https://github.com/NFDI4Chem/nmrxiv into prod-…
…helm-deploy
- Loading branch information
Showing
20 changed files
with
374 additions
and
109 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
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,66 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Http\Resources\StudyResource; | ||
use Illuminate\Http\Request; | ||
use Inertia\Inertia; | ||
use Response; | ||
|
||
class OEmbedController extends Controller | ||
{ | ||
public function spectra(Request $request) | ||
{ | ||
$url = $request->get('url'); | ||
$format = $request->get('format'); | ||
$height = $request->get('height'); | ||
$width = $request->get('width'); | ||
$parsedURL = parse_url($url); | ||
$URLPath = $parsedURL['path']; | ||
$identifier = preg_split('#/#', $URLPath)[1]; | ||
if ($identifier) { | ||
$resolvedModel = resolveIdentifier($identifier); | ||
$namespace = $resolvedModel['namespace']; | ||
$model = $resolvedModel['model']; | ||
// dd($model); | ||
if ($model) { | ||
$data = [ | ||
'success' => true, | ||
'type' => 'rich', | ||
'version' => '1.0', | ||
'provider_name' => config('app.name'), | ||
'provider_url' => config('app.url'), | ||
'title' => $model->name, | ||
'author_name' => $model->owner->name, | ||
'author_url' => config('app.url').'/author/'.$model->owner->username, | ||
'height' => $height ? $height : '300', | ||
'width' => $width ? $width : '320', | ||
'thumbnail_width' => '300', | ||
'thumbnail_height' => '125', | ||
'thumbnail_url' => $model->study_preview_urls[0], | ||
'html' => '<iframe id="nmrxiv_embed" class="nmrxiv_embed_iframe" style="width: 100%; overflow: hidden;" src="'.config('app.url').'/embed/'.$model->identifier.'" width="300" height="300" frameborder="0" scrolling="no"></iframe>', | ||
]; | ||
|
||
return Response::json($data); | ||
} | ||
} | ||
} | ||
|
||
public function embed(Request $request, $identifier) | ||
{ | ||
$resolvedModel = resolveIdentifier($identifier); | ||
$namespace = $resolvedModel['namespace']; | ||
$model = $resolvedModel['model']; | ||
if ($model) { | ||
if ($namespace == 'Study') { | ||
$study = $model; | ||
|
||
return Inertia::render('Public/Embed/Sample', [ | ||
'study' => (new StudyResource($study))->lite(false, ['tags', 'sample', 'datasets', 'molecules', 'owner', 'license']), | ||
]); | ||
} elseif ($namespace == 'Dataset') { | ||
$dataset = $model; | ||
} | ||
} | ||
} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
namespace App\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ProjectPublishNotifyAdmins extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
public $project; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($project) | ||
{ | ||
$this->project = $project; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
return $this->markdown('vendor.mail.project-publish-notify-admins', [ | ||
'url' => url(config('app.url').'/dashboard/projects/'.$this->project->id), | ||
'projectName' => $this->project->name, | ||
'projectId' => $this->project->id, | ||
])->subject(__('A project has been published'.' - '.$this->project->name)); | ||
} | ||
} |
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,60 @@ | ||
<?php | ||
|
||
namespace App\Notifications; | ||
|
||
use App\Mail\ProjectPublishNotifyAdmins; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class ProjectPublishNotificationToAdmins extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
private $project; | ||
|
||
/** | ||
* Create a new notification instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct($project) | ||
{ | ||
$this->project = $project; | ||
} | ||
|
||
/** | ||
* Get the notification's delivery channels. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
public function via($notifiable) | ||
{ | ||
return ['mail']; | ||
} | ||
|
||
/** | ||
* Get the mail representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return \Illuminate\Notifications\Messages\MailMessage | ||
*/ | ||
public function toMail($notifiable) | ||
{ | ||
return (new ProjectPublishNotifyAdmins($this->project))->to($notifiable->email); | ||
} | ||
|
||
/** | ||
* Get the array representation of the notification. | ||
* | ||
* @param mixed $notifiable | ||
* @return array | ||
*/ | ||
public function toArray($notifiable) | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,4 @@ | ||
# API | ||
|
||
nmrXiv infrastructure supports API through which software developers can interact with the data programmatically. Postman tool is used to document how nmrXiv API should be used, methods, status, and error codes supported. | ||
The infrastructure of nmrXiv facilitates API access, enabling software developers to interact with the data programmatically. The documentation for nmrXiv API, including information on methods, status, and supported error codes, is provided using [Swagger](https://swagger.io/). For detailed insights into API usage, please refer to our [Swagger documentation](https://nmrxiv.org/api/documentation). | ||
|
||
Postman allows you to publish documentation quickly and easily. Postman automatically pulls your sample requests, headers, code snippets, etc., to populate your documentation page with dynamic examples and machine-readable instructions so you can easily share your API with the rest of the world. | ||
|
||
## [nmrXiv APIs](https://www.postman.com/nmrxiv-jena/workspace/nmrxiv/request/17173369-2ef7d5a8-0121-418b-8762-cc47d7a5b7cd) | ||
|
||
<img src="/img/postman.png"/> | ||
|
||
<br/><br/> | ||
If you are interested in specific endpoints, check out the following quick links: | ||
|
||
- [Authentication and Authorisation](https://www.postman.com/nmrxiv-jena/workspace/nmrxiv/collection/17173369-f372ec15-9b92-4902-8844-b129ab0c17d1?ctx=documentation) | ||
- [Projects/Studies/Dataset](https://www.postman.com/nmrxiv-jena/workspace/nmrxiv/collection/17173369-b00475c3-6171-4e58-97ab-cb88b3ac4c59?ctx=documentation) | ||
- [Bioschemas](https://www.postman.com/nmrxiv-jena/workspace/nmrxiv/folder/17195598-561a4bcc-7c84-4669-b245-c8416dfc8e90?ctx=documentation) |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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.