@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Expose Drydock blueprints via Conduit

Summary:
This search engine ports cleanly to Conduit out of the box.

Ref T11694

Test Plan: called the API method from the console, browsed blueprints in the ui

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T11694

Differential Revision: https://secure.phabricator.com/D16593

authored by

Mike Riley and committed by
yelirekim
8759f7e6 508a2a14

+52 -1
+3
src/__phutil_library_map__.php
··· 940 940 'DrydockBlueprintNameNgrams' => 'applications/drydock/storage/DrydockBlueprintNameNgrams.php', 941 941 'DrydockBlueprintPHIDType' => 'applications/drydock/phid/DrydockBlueprintPHIDType.php', 942 942 'DrydockBlueprintQuery' => 'applications/drydock/query/DrydockBlueprintQuery.php', 943 + 'DrydockBlueprintSearchConduitAPIMethod' => 'applications/drydock/conduit/DrydockBlueprintSearchConduitAPIMethod.php', 943 944 'DrydockBlueprintSearchEngine' => 'applications/drydock/query/DrydockBlueprintSearchEngine.php', 944 945 'DrydockBlueprintTransaction' => 'applications/drydock/storage/DrydockBlueprintTransaction.php', 945 946 'DrydockBlueprintTransactionQuery' => 'applications/drydock/query/DrydockBlueprintTransactionQuery.php', ··· 5512 5513 'PhabricatorCustomFieldInterface', 5513 5514 'PhabricatorNgramsInterface', 5514 5515 'PhabricatorProjectInterface', 5516 + 'PhabricatorConduitResultInterface', 5515 5517 ), 5516 5518 'DrydockBlueprintController' => 'DrydockController', 5517 5519 'DrydockBlueprintCoreCustomField' => array( ··· 5530 5532 'DrydockBlueprintNameNgrams' => 'PhabricatorSearchNgrams', 5531 5533 'DrydockBlueprintPHIDType' => 'PhabricatorPHIDType', 5532 5534 'DrydockBlueprintQuery' => 'DrydockQuery', 5535 + 'DrydockBlueprintSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5533 5536 'DrydockBlueprintSearchEngine' => 'PhabricatorApplicationSearchEngine', 5534 5537 'DrydockBlueprintTransaction' => 'PhabricatorApplicationTransaction', 5535 5538 'DrydockBlueprintTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
+18
src/applications/drydock/conduit/DrydockBlueprintSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class DrydockBlueprintSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'drydock.blueprint.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new DrydockBlueprintSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Retrieve information about Drydock blueprints.'); 16 + } 17 + 18 + }
+31 -1
src/applications/drydock/storage/DrydockBlueprint.php
··· 10 10 PhabricatorPolicyInterface, 11 11 PhabricatorCustomFieldInterface, 12 12 PhabricatorNgramsInterface, 13 - PhabricatorProjectInterface { 13 + PhabricatorProjectInterface, 14 + PhabricatorConduitResultInterface { 14 15 15 16 protected $className; 16 17 protected $blueprintName; ··· 357 358 return array( 358 359 id(new DrydockBlueprintNameNgrams()) 359 360 ->setValue($this->getBlueprintName()), 361 + ); 362 + } 363 + 364 + 365 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 366 + 367 + 368 + public function getFieldSpecificationsForConduit() { 369 + return array( 370 + id(new PhabricatorConduitSearchFieldSpecification()) 371 + ->setKey('name') 372 + ->setType('string') 373 + ->setDescription(pht('The name of this blueprint.')), 374 + id(new PhabricatorConduitSearchFieldSpecification()) 375 + ->setKey('type') 376 + ->setType('string') 377 + ->setDescription(pht('The type of resource this blueprint provides.')), 378 + ); 379 + } 380 + 381 + public function getFieldValuesForConduit() { 382 + return array( 383 + 'name' => $this->getBlueprintName(), 384 + 'type' => $this->getImplementation()->getType(), 385 + ); 386 + } 387 + 388 + public function getConduitSearchAttachments() { 389 + return array( 360 390 ); 361 391 } 362 392