# HG changeset patch # User ymh # Date 1508160128 -7200 # Node ID 2c579ea45608690e7b397c91ce00ccc043fd426e # Parent e70004b11b3b50440c2479f9afefcd91359fb151 Add email and description in handle registry entries diff -r e70004b11b3b -r 2c579ea45608 server/src/.env.example --- a/server/src/.env.example Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/.env.example Mon Oct 16 15:22:08 2017 +0200 @@ -54,6 +54,8 @@ HANDLE_ADMIN_ID=CORPUS_ADMIN HANDLE_CERT_OR_PKEY="" HANDLE_PASSWORD=NULL +HANDLE_TITLE_PREFIX="Trésors de la parole" +HANDLE_CONTACT_EMAIL="" # Geonames user name (cf. http://www.geonames.org/login) diff -r e70004b11b3b -r 2c579ea45608 server/src/app/Console/Commands/ManageHandles.php --- a/server/src/app/Console/Commands/ManageHandles.php Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/app/Console/Commands/ManageHandles.php Mon Oct 16 15:22:08 2017 +0200 @@ -47,7 +47,7 @@ } private function registerHandle($doc) { - $this->handleClient->createHandleUrlRecord($doc->getId(), config('app.url')."/docs/".$doc->getId()); + $this->handleClient->createHandleUrlRecord($doc->getId(), config('app.url')."/docs/".$doc->getId(), $doc->getTitle()); } /** diff -r e70004b11b3b -r 2c579ea45608 server/src/app/Libraries/Handle/HandleClient.php --- a/server/src/app/Libraries/Handle/HandleClient.php Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/app/Libraries/Handle/HandleClient.php Mon Oct 16 15:22:08 2017 +0200 @@ -1,9 +1,9 @@ getStatusCode().': '.$delRes->getReasonPhrase()); } - public function createHandleUrlRecord($handle, $url) { + public function createHandleUrlRecord($handle, $url, $title) { $this->initSession(); $currentDate = gmstrftime('%Y-%m-%dT%H:%M:%SZ'); $handleRecord = [ 'values' => [ ['index' => 1, 'ttl' => 86400, 'type' => 'URL', 'timestamp' => $currentDate, 'data' => ['value'=> $url, 'format'=> 'string']], + ['index' => 2, 'ttl' => 86400, 'type' => 'DESC', 'timestamp' => $currentDate, 'data' => ['value'=> config('corpusparole.handle_title_prefix')." : $title", 'format'=> 'string']], + ['index' => 3, 'ttl' => 86400, 'type' => 'EMAIL', 'timestamp' => $currentDate, 'data' => ['value'=> config('corpusparole.handle_contact_email'), 'format'=> 'string']], ['index' => 100, 'ttl' => 86400, 'type' => 'HS_ADMIN', 'timestamp' => $currentDate, 'data' => [ 'value' => ['index' => 200, 'handle' => $this->adminId], 'permissions' => '011111110011', diff -r e70004b11b3b -r 2c579ea45608 server/src/config/corpusparole.php --- a/server/src/config/corpusparole.php Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/config/corpusparole.php Mon Oct 16 15:22:08 2017 +0200 @@ -188,12 +188,14 @@ "exportApplicationGlobal" => true ], - 'handle_host' => env('HANDLE_HOST'), - 'handle_port' => env('HANDLE_PORT', 8000), - 'handle_admin_id' => env('HANDLE_ADMIN_ID'), - 'handle_prefix' => env('HANDLE_PREFIX'), - 'handle_cert_or_pkey' => env('HANDLE_CERT_OR_PKEY'), - 'handle_password' => env('HANDLE_PASSWORD'), + 'handle_host' => env('HANDLE_HOST'), + 'handle_port' => env('HANDLE_PORT', 8000), + 'handle_admin_id' => env('HANDLE_ADMIN_ID'), + 'handle_prefix' => env('HANDLE_PREFIX'), + 'handle_cert_or_pkey' => env('HANDLE_CERT_OR_PKEY'), + 'handle_password' => env('HANDLE_PASSWORD'), + 'handle_title_prefix' => env('HANDLE_TITLE_PREFIX','Trésors de la parole'), + 'handle_contact_email' => env('HANDLE_CONTACT_EMAIL'), 'transcript_default_creator' => 'Corpus de la Parole', 'transcrit_decoder_mapping' => [ diff -r e70004b11b3b -r 2c579ea45608 server/src/phpunit.xml --- a/server/src/phpunit.xml Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/phpunit.xml Mon Oct 16 15:22:08 2017 +0200 @@ -35,6 +35,8 @@ + + diff -r e70004b11b3b -r 2c579ea45608 server/src/tests/Libraries/Handle/HandleClientIntegrationTest.php --- a/server/src/tests/Libraries/Handle/HandleClientIntegrationTest.php Mon Oct 16 15:18:53 2017 +0200 +++ b/server/src/tests/Libraries/Handle/HandleClientIntegrationTest.php Mon Oct 16 15:22:08 2017 +0200 @@ -182,7 +182,7 @@ //$handle = "$this->testPrefix/TEST_HANDLE_CLIENT_"; - $handleClient->createHandleUrlRecord($handle, "http://www.example.com"); + $handleClient->createHandleUrlRecord($handle, "http://www.example.com", "Great title"); $pagination = $handleClient->paginateAll($this->testPrefix); @@ -206,7 +206,7 @@ $handle = strtoupper(uniqid("$this->testPrefix/TEST_HANDLE_CLIENT_")); - $handleClient->createHandleUrlRecord($handle, "http://www.example.com"); + $handleClient->createHandleUrlRecord($handle, "http://www.example.com", "Great title"); $handleClient->deleteHandle($handle);