@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.

Add "almanac.namespace.edit" and "almanac.namespace.search" API methods

Summary: Depends on D19336. Ref T13120. Ref T12414. These are simple, straightforward, and uninteresting.

Test Plan:
- Searched for namespaces with "almanac.namespace.search".
- Created and edited namespaces with "almanac.namespace.edit".

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13120, T12414

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

+68 -1
+5
src/__phutil_library_map__.php
··· 88 88 'AlmanacNamesTestCase' => 'applications/almanac/util/__tests__/AlmanacNamesTestCase.php', 89 89 'AlmanacNamespace' => 'applications/almanac/storage/AlmanacNamespace.php', 90 90 'AlmanacNamespaceController' => 'applications/almanac/controller/AlmanacNamespaceController.php', 91 + 'AlmanacNamespaceEditConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php', 91 92 'AlmanacNamespaceEditController' => 'applications/almanac/controller/AlmanacNamespaceEditController.php', 92 93 'AlmanacNamespaceEditEngine' => 'applications/almanac/editor/AlmanacNamespaceEditEngine.php', 93 94 'AlmanacNamespaceEditor' => 'applications/almanac/editor/AlmanacNamespaceEditor.php', ··· 96 97 'AlmanacNamespaceNameTransaction' => 'applications/almanac/xaction/AlmanacNamespaceNameTransaction.php', 97 98 'AlmanacNamespacePHIDType' => 'applications/almanac/phid/AlmanacNamespacePHIDType.php', 98 99 'AlmanacNamespaceQuery' => 'applications/almanac/query/AlmanacNamespaceQuery.php', 100 + 'AlmanacNamespaceSearchConduitAPIMethod' => 'applications/almanac/conduit/AlmanacNamespaceSearchConduitAPIMethod.php', 99 101 'AlmanacNamespaceSearchEngine' => 'applications/almanac/query/AlmanacNamespaceSearchEngine.php', 100 102 'AlmanacNamespaceTransaction' => 'applications/almanac/storage/AlmanacNamespaceTransaction.php', 101 103 'AlmanacNamespaceTransactionQuery' => 'applications/almanac/query/AlmanacNamespaceTransactionQuery.php', ··· 5301 5303 'AlmanacPropertyInterface', 5302 5304 'PhabricatorDestructibleInterface', 5303 5305 'PhabricatorNgramsInterface', 5306 + 'PhabricatorConduitResultInterface', 5304 5307 ), 5305 5308 'AlmanacNamespaceController' => 'AlmanacController', 5309 + 'AlmanacNamespaceEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 5306 5310 'AlmanacNamespaceEditController' => 'AlmanacNamespaceController', 5307 5311 'AlmanacNamespaceEditEngine' => 'PhabricatorEditEngine', 5308 5312 'AlmanacNamespaceEditor' => 'AlmanacEditor', ··· 5311 5315 'AlmanacNamespaceNameTransaction' => 'AlmanacNamespaceTransactionType', 5312 5316 'AlmanacNamespacePHIDType' => 'PhabricatorPHIDType', 5313 5317 'AlmanacNamespaceQuery' => 'AlmanacQuery', 5318 + 'AlmanacNamespaceSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5314 5319 'AlmanacNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine', 5315 5320 'AlmanacNamespaceTransaction' => 'AlmanacModularTransaction', 5316 5321 'AlmanacNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
+19
src/applications/almanac/conduit/AlmanacNamespaceEditConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class AlmanacNamespaceEditConduitAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'almanac.namespace.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new AlmanacNamespaceEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new namespace or edit an existing one.'); 17 + } 18 + 19 + }
+18
src/applications/almanac/conduit/AlmanacNamespaceSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class AlmanacNamespaceSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'almanac.namespace.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new AlmanacNamespaceSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about Almanac namespaces.'); 16 + } 17 + 18 + }
+26 -1
src/applications/almanac/storage/AlmanacNamespace.php
··· 8 8 PhabricatorProjectInterface, 9 9 AlmanacPropertyInterface, 10 10 PhabricatorDestructibleInterface, 11 - PhabricatorNgramsInterface { 11 + PhabricatorNgramsInterface, 12 + PhabricatorConduitResultInterface { 12 13 13 14 protected $name; 14 15 protected $nameIndex; ··· 223 224 ->setValue($this->getName()), 224 225 ); 225 226 } 227 + 228 + 229 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 230 + 231 + 232 + public function getFieldSpecificationsForConduit() { 233 + return array( 234 + id(new PhabricatorConduitSearchFieldSpecification()) 235 + ->setKey('name') 236 + ->setType('string') 237 + ->setDescription(pht('The name of the namespace.')), 238 + ); 239 + } 240 + 241 + public function getFieldValuesForConduit() { 242 + return array( 243 + 'name' => $this->getName(), 244 + ); 245 + } 246 + 247 + public function getConduitSearchAttachments() { 248 + return array(); 249 + } 250 + 226 251 227 252 }