-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Drupal\islandora_riprap\Controller; | ||
|
||
use Drupal\Core\Controller\ControllerBase; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* Controller. | ||
*/ | ||
class IslandoraRiprapPremisController extends ControllerBase { | ||
public function __construct() { | ||
$config = \Drupal::config('islandora_riprap.settings'); | ||
$this->riprap_endpoint = $config->get('riprap_rest_endpoint') ?: 'http://localhost:8000/api/fixity'; | ||
$this->number_of_events = $config->get('number_of_events') ?: 10; | ||
$this->use_drupal_urls = $config->get('use_drupal_urls') ?: FALSE; | ||
$this->gemini_endpoint = $config->get('gemini_rest_endpoint') ?: 'http://localhost:8000/gemini'; | ||
} | ||
|
||
/** | ||
* Get the Riprap data for the current Media entity and render it as Turtle. | ||
* | ||
* @return string | ||
*/ | ||
public function main() { | ||
$current_path = \Drupal::service('path.current')->getPath(); | ||
$path_args = explode('/', $current_path); | ||
$mid = $path_args[2]; | ||
|
||
$output = '@prefix premis: <http://www.loc.gov/premis/rdf/v3/> .' . "\n"; | ||
$output .= "\n"; | ||
$output .= '<http://example.com/a/resource/uri>'; | ||
|
||
$response = new Response($output, 200); | ||
$response->headers->set("Content-Type", 'text/turtle'); | ||
return $response; | ||
} | ||
|
||
} | ||
|
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,6 +1,6 @@ | ||
<div {{ attributes }}> | ||
<div class="islandora_riprap_report"> | ||
<h4>Sample Riprap output - does not correspond to current media</h4> | ||
<p>Fixity events for resource associated with Media {{ mid }}.</p> | ||
<pre>{{ report }}</pre> | ||
</div> | ||
</div> |