Correct Handle creation and correct permalink
authorymh <ymh.work@gmail.com>
Fri, 17 Nov 2017 16:05:03 +0100
changeset 563 41e4eb4d8b82
parent 562 210420362d64
child 564 e98053e217d7
Correct Handle creation and correct permalink
cms/app-client/app/templates/components/notice-component.hbs
cms/app-client/app/templates/components/playlist-component.hbs
server/src/app/Console/Commands/ManageHandles.php
--- a/cms/app-client/app/templates/components/notice-component.hbs	Fri Nov 17 11:41:58 2017 +0100
+++ b/cms/app-client/app/templates/components/notice-component.hbs	Fri Nov 17 16:05:03 2017 +0100
@@ -3,7 +3,7 @@
 <h3>{{ item.alternativeTitle }}</h3>
 {{/if}}
 <div class="notice-links">
-  <h5>{{#if item.id }}<a href={{abs-url-for "document" item.id}} class="notice-permalink" target="_blank">permalien</a>{{/if}}</h5>
+  <h5>{{#if item.id }}<a href={{concat "https://hdl.handle.net/" item.id}} class="notice-permalink" target="_blank">permalien</a>{{/if}}</h5>
   <h5>{{#if item.cocoonId }}<a href={{noticeCocoonPurlUrl}} class="notice-permalink" target="_blank">notice sur Cocoon</a>{{/if}}</h5>
 </div>
 <table>
--- a/cms/app-client/app/templates/components/playlist-component.hbs	Fri Nov 17 11:41:58 2017 +0100
+++ b/cms/app-client/app/templates/components/playlist-component.hbs	Fri Nov 17 16:05:03 2017 +0100
@@ -40,9 +40,9 @@
                   as |popover| }}
                     <p>Partager un lien vers cette notice</p>
                     <div>
-                    {{input id=(concat "popup-playlist-share-button-text-" index) value=(abs-url-for "document" document.id) readonly='readonly' class='playlist-share-button-link'}}
+                    {{input id=(concat "popup-playlist-share-button-text-" index) value=(concat "https://hdl.handle.net/" item.id) readonly='readonly' class='playlist-share-button-link'}}
                     </div>
-                    <div class="ssk-group ssk-xs playlist-share-button-list" data-url={{abs-url-for "document" document.id}} data-title="Corpus de la Parole : {{ document.title }}" data-text="Partager cette notice">
+                    <div class="ssk-group ssk-xs playlist-share-button-list" data-url={{concat "https://hdl.handle.net/" item.id}} data-title="Corpus de la Parole : {{ document.title }}" data-text="Partager cette notice">
                         <a href="" class="ssk ssk-facebook"></a>
                         <a href="" class="ssk ssk-twitter"></a>
                         <a href="" class="ssk ssk-google-plus"></a>
--- a/server/src/app/Console/Commands/ManageHandles.php	Fri Nov 17 11:41:58 2017 +0100
+++ b/server/src/app/Console/Commands/ManageHandles.php	Fri Nov 17 16:05:03 2017 +0100
@@ -5,7 +5,7 @@
 use Illuminate\Console\Command;
 
 use GuzzleHttp\Client;
-use CorpusParole\Libraries\Handle\handleClient;
+use CorpusParole\Libraries\Handle\HandleClient;
 use CorpusParole\Libraries\CocoonUtils;
 use CorpusParole\Repositories\DocumentRepository;
 
@@ -47,7 +47,8 @@
     }
 
     private function registerHandle($doc) {
-        $this->handleClient->createHandleUrlRecord($doc->getId(), config('app.url')."/docs/".$doc->getId(), $doc->getTitle());
+        $baseUrl = str_replace('corpus-back', 'corpus-app', config('app.url'));
+        $this->handleClient->createHandleUrlRecord($doc->getId(), "$baseUrl#/doc/".urlencode($doc->getId()), $doc->getTitle());
     }
 
     /**