server/src/app/Console/Commands/ManageHandles.php
changeset 563 41e4eb4d8b82
parent 552 2c579ea45608
child 565 5e02aa0899f7
equal deleted inserted replaced
562:210420362d64 563:41e4eb4d8b82
     3 namespace CorpusParole\Console\Commands;
     3 namespace CorpusParole\Console\Commands;
     4 
     4 
     5 use Illuminate\Console\Command;
     5 use Illuminate\Console\Command;
     6 
     6 
     7 use GuzzleHttp\Client;
     7 use GuzzleHttp\Client;
     8 use CorpusParole\Libraries\Handle\handleClient;
     8 use CorpusParole\Libraries\Handle\HandleClient;
     9 use CorpusParole\Libraries\CocoonUtils;
     9 use CorpusParole\Libraries\CocoonUtils;
    10 use CorpusParole\Repositories\DocumentRepository;
    10 use CorpusParole\Repositories\DocumentRepository;
    11 
    11 
    12 class ManageHandles extends Command
    12 class ManageHandles extends Command
    13 {
    13 {
    45         $this->httpClient = $httpClient;
    45         $this->httpClient = $httpClient;
    46         parent::__construct();
    46         parent::__construct();
    47     }
    47     }
    48 
    48 
    49     private function registerHandle($doc) {
    49     private function registerHandle($doc) {
    50         $this->handleClient->createHandleUrlRecord($doc->getId(), config('app.url')."/docs/".$doc->getId(), $doc->getTitle());
    50         $baseUrl = str_replace('corpus-back', 'corpus-app', config('app.url'));
       
    51         $this->handleClient->createHandleUrlRecord($doc->getId(), "$baseUrl#/doc/".urlencode($doc->getId()), $doc->getTitle());
    51     }
    52     }
    52 
    53 
    53     /**
    54     /**
    54      * Execute the console command.
    55      * Execute the console command.
    55      *
    56      *