@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 stub "harbormaster.build.edit" and "harbormaster.buildable.edit" API methods

Summary: Ref T13072. These don't do anything useful yet, but get the skeletons in.

Test Plan: Loaded documentation pages without fataling.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13072

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

+219
+8
src/__phutil_library_map__.php
··· 1388 1388 'HarbormasterBuildArtifactQuery' => 'applications/harbormaster/query/HarbormasterBuildArtifactQuery.php', 1389 1389 'HarbormasterBuildAutoplan' => 'applications/harbormaster/autoplan/HarbormasterBuildAutoplan.php', 1390 1390 'HarbormasterBuildDependencyDatasource' => 'applications/harbormaster/typeahead/HarbormasterBuildDependencyDatasource.php', 1391 + 'HarbormasterBuildEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php', 1392 + 'HarbormasterBuildEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildEditEngine.php', 1391 1393 'HarbormasterBuildEngine' => 'applications/harbormaster/engine/HarbormasterBuildEngine.php', 1392 1394 'HarbormasterBuildFailureException' => 'applications/harbormaster/exception/HarbormasterBuildFailureException.php', 1393 1395 'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php', ··· 1472 1474 'HarbormasterBuildable' => 'applications/harbormaster/storage/HarbormasterBuildable.php', 1473 1475 'HarbormasterBuildableActionController' => 'applications/harbormaster/controller/HarbormasterBuildableActionController.php', 1474 1476 'HarbormasterBuildableAdapterInterface' => 'applications/harbormaster/herald/HarbormasterBuildableAdapterInterface.php', 1477 + 'HarbormasterBuildableEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php', 1478 + 'HarbormasterBuildableEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildableEditEngine.php', 1475 1479 'HarbormasterBuildableEngine' => 'applications/harbormaster/engine/HarbormasterBuildableEngine.php', 1476 1480 'HarbormasterBuildableInterface' => 'applications/harbormaster/interface/HarbormasterBuildableInterface.php', 1477 1481 'HarbormasterBuildableListController' => 'applications/harbormaster/controller/HarbormasterBuildableListController.php', ··· 7605 7609 'HarbormasterBuildArtifactQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 7606 7610 'HarbormasterBuildAutoplan' => 'Phobject', 7607 7611 'HarbormasterBuildDependencyDatasource' => 'PhabricatorTypeaheadDatasource', 7612 + 'HarbormasterBuildEditAPIMethod' => 'PhabricatorEditEngineAPIMethod', 7613 + 'HarbormasterBuildEditEngine' => 'PhabricatorEditEngine', 7608 7614 'HarbormasterBuildEngine' => 'Phobject', 7609 7615 'HarbormasterBuildFailureException' => 'Exception', 7610 7616 'HarbormasterBuildGraph' => 'AbstractDirectedGraph', ··· 7730 7736 'PhabricatorDestructibleInterface', 7731 7737 ), 7732 7738 'HarbormasterBuildableActionController' => 'HarbormasterController', 7739 + 'HarbormasterBuildableEditAPIMethod' => 'PhabricatorEditEngineAPIMethod', 7740 + 'HarbormasterBuildableEditEngine' => 'PhabricatorEditEngine', 7733 7741 'HarbormasterBuildableEngine' => 'Phobject', 7734 7742 'HarbormasterBuildableListController' => 'HarbormasterController', 7735 7743 'HarbormasterBuildableMessageTransaction' => 'HarbormasterBuildableTransactionType',
+20
src/applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildEditAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'harbormaster.build.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new HarbormasterBuildEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new build or edit an existing '. 17 + 'one.'); 18 + } 19 + 20 + }
+20
src/applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildableEditAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'harbormaster.buildable.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new HarbormasterBuildableEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new buildable or edit an existing '. 17 + 'one.'); 18 + } 19 + 20 + }
+87
src/applications/harbormaster/editor/HarbormasterBuildEditEngine.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildEditEngine 4 + extends PhabricatorEditEngine { 5 + 6 + const ENGINECONST = 'harbormaster.build'; 7 + 8 + public function isEngineConfigurable() { 9 + return false; 10 + } 11 + 12 + public function getEngineName() { 13 + return pht('Harbormaster Builds'); 14 + } 15 + 16 + public function getSummaryHeader() { 17 + return pht('Edit Harbormaster Build Configurations'); 18 + } 19 + 20 + public function getSummaryText() { 21 + return pht('This engine is used to edit Harbormaster builds.'); 22 + } 23 + 24 + public function getEngineApplicationClass() { 25 + return 'PhabricatorHarbormasterApplication'; 26 + } 27 + 28 + protected function newEditableObject() { 29 + $viewer = $this->getViewer(); 30 + return HarbormasterBuild::initializeNewBuild($viewer); 31 + } 32 + 33 + protected function newObjectQuery() { 34 + return new HarbormasterBuildQuery(); 35 + } 36 + 37 + protected function newEditableObjectForDocumentation() { 38 + $object = new DifferentialRevision(); 39 + 40 + $buildable = id(new HarbormasterBuildable()) 41 + ->attachBuildableObject($object); 42 + 43 + return $this->newEditableObject() 44 + ->attachBuildable($buildable); 45 + } 46 + 47 + protected function getObjectCreateTitleText($object) { 48 + return pht('Create Build'); 49 + } 50 + 51 + protected function getObjectCreateButtonText($object) { 52 + return pht('Create Build'); 53 + } 54 + 55 + protected function getObjectEditTitleText($object) { 56 + return pht('Edit Build: %s', $object->getName()); 57 + } 58 + 59 + protected function getObjectEditShortText($object) { 60 + return pht('Edit Build'); 61 + } 62 + 63 + protected function getObjectCreateShortText() { 64 + return pht('Create Build'); 65 + } 66 + 67 + protected function getObjectName() { 68 + return pht('Build'); 69 + } 70 + 71 + protected function getEditorURI() { 72 + return '/harbormaster/build/edit/'; 73 + } 74 + 75 + protected function getObjectCreateCancelURI($object) { 76 + return '/harbormaster/'; 77 + } 78 + 79 + protected function getObjectViewURI($object) { 80 + return $object->getURI(); 81 + } 82 + 83 + protected function buildCustomEditFields($object) { 84 + return array(); 85 + } 86 + 87 + }
+84
src/applications/harbormaster/editor/HarbormasterBuildableEditEngine.php
··· 1 + <?php 2 + 3 + final class HarbormasterBuildableEditEngine 4 + extends PhabricatorEditEngine { 5 + 6 + const ENGINECONST = 'harbormaster.buildable'; 7 + 8 + public function isEngineConfigurable() { 9 + return false; 10 + } 11 + 12 + public function getEngineName() { 13 + return pht('Harbormaster Buildables'); 14 + } 15 + 16 + public function getSummaryHeader() { 17 + return pht('Edit Harbormaster Buildable Configurations'); 18 + } 19 + 20 + public function getSummaryText() { 21 + return pht('This engine is used to edit Harbormaster buildables.'); 22 + } 23 + 24 + public function getEngineApplicationClass() { 25 + return 'PhabricatorHarbormasterApplication'; 26 + } 27 + 28 + protected function newEditableObject() { 29 + $viewer = $this->getViewer(); 30 + return HarbormasterBuildable::initializeNewBuildable($viewer); 31 + } 32 + 33 + protected function newObjectQuery() { 34 + return new HarbormasterBuildableQuery(); 35 + } 36 + 37 + protected function newEditableObjectForDocumentation() { 38 + $object = new DifferentialRevision(); 39 + 40 + return $this->newEditableObject() 41 + ->attachBuildableObject($object); 42 + } 43 + 44 + protected function getObjectCreateTitleText($object) { 45 + return pht('Create Buildable'); 46 + } 47 + 48 + protected function getObjectCreateButtonText($object) { 49 + return pht('Create Buildable'); 50 + } 51 + 52 + protected function getObjectEditTitleText($object) { 53 + return pht('Edit Buildable: %s', $object->getName()); 54 + } 55 + 56 + protected function getObjectEditShortText($object) { 57 + return pht('Edit Buildable'); 58 + } 59 + 60 + protected function getObjectCreateShortText() { 61 + return pht('Create Buildable'); 62 + } 63 + 64 + protected function getObjectName() { 65 + return pht('Buildable'); 66 + } 67 + 68 + protected function getEditorURI() { 69 + return '/harbormaster/buildable/edit/'; 70 + } 71 + 72 + protected function getObjectCreateCancelURI($object) { 73 + return '/harbormaster/'; 74 + } 75 + 76 + protected function getObjectViewURI($object) { 77 + return $object->getURI(); 78 + } 79 + 80 + protected function buildCustomEditFields($object) { 81 + return array(); 82 + } 83 + 84 + }