Page MenuHomePhabricator

D21695.diff
No OneTemporary

D21695.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1388,6 +1388,8 @@
'HarbormasterBuildArtifactQuery' => 'applications/harbormaster/query/HarbormasterBuildArtifactQuery.php',
'HarbormasterBuildAutoplan' => 'applications/harbormaster/autoplan/HarbormasterBuildAutoplan.php',
'HarbormasterBuildDependencyDatasource' => 'applications/harbormaster/typeahead/HarbormasterBuildDependencyDatasource.php',
+ 'HarbormasterBuildEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php',
+ 'HarbormasterBuildEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildEditEngine.php',
'HarbormasterBuildEngine' => 'applications/harbormaster/engine/HarbormasterBuildEngine.php',
'HarbormasterBuildFailureException' => 'applications/harbormaster/exception/HarbormasterBuildFailureException.php',
'HarbormasterBuildGraph' => 'applications/harbormaster/engine/HarbormasterBuildGraph.php',
@@ -1472,6 +1474,8 @@
'HarbormasterBuildable' => 'applications/harbormaster/storage/HarbormasterBuildable.php',
'HarbormasterBuildableActionController' => 'applications/harbormaster/controller/HarbormasterBuildableActionController.php',
'HarbormasterBuildableAdapterInterface' => 'applications/harbormaster/herald/HarbormasterBuildableAdapterInterface.php',
+ 'HarbormasterBuildableEditAPIMethod' => 'applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php',
+ 'HarbormasterBuildableEditEngine' => 'applications/harbormaster/editor/HarbormasterBuildableEditEngine.php',
'HarbormasterBuildableEngine' => 'applications/harbormaster/engine/HarbormasterBuildableEngine.php',
'HarbormasterBuildableInterface' => 'applications/harbormaster/interface/HarbormasterBuildableInterface.php',
'HarbormasterBuildableListController' => 'applications/harbormaster/controller/HarbormasterBuildableListController.php',
@@ -7605,6 +7609,8 @@
'HarbormasterBuildArtifactQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'HarbormasterBuildAutoplan' => 'Phobject',
'HarbormasterBuildDependencyDatasource' => 'PhabricatorTypeaheadDatasource',
+ 'HarbormasterBuildEditAPIMethod' => 'PhabricatorEditEngineAPIMethod',
+ 'HarbormasterBuildEditEngine' => 'PhabricatorEditEngine',
'HarbormasterBuildEngine' => 'Phobject',
'HarbormasterBuildFailureException' => 'Exception',
'HarbormasterBuildGraph' => 'AbstractDirectedGraph',
@@ -7730,6 +7736,8 @@
'PhabricatorDestructibleInterface',
),
'HarbormasterBuildableActionController' => 'HarbormasterController',
+ 'HarbormasterBuildableEditAPIMethod' => 'PhabricatorEditEngineAPIMethod',
+ 'HarbormasterBuildableEditEngine' => 'PhabricatorEditEngine',
'HarbormasterBuildableEngine' => 'Phobject',
'HarbormasterBuildableListController' => 'HarbormasterController',
'HarbormasterBuildableMessageTransaction' => 'HarbormasterBuildableTransactionType',
diff --git a/src/applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php b/src/applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/harbormaster/conduit/HarbormasterBuildEditAPIMethod.php
@@ -0,0 +1,20 @@
+<?php
+
+final class HarbormasterBuildEditAPIMethod
+ extends PhabricatorEditEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'harbormaster.build.edit';
+ }
+
+ public function newEditEngine() {
+ return new HarbormasterBuildEditEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht(
+ 'Apply transactions to create a new build or edit an existing '.
+ 'one.');
+ }
+
+}
diff --git a/src/applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php b/src/applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/harbormaster/conduit/HarbormasterBuildableEditAPIMethod.php
@@ -0,0 +1,20 @@
+<?php
+
+final class HarbormasterBuildableEditAPIMethod
+ extends PhabricatorEditEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'harbormaster.buildable.edit';
+ }
+
+ public function newEditEngine() {
+ return new HarbormasterBuildableEditEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht(
+ 'Apply transactions to create a new buildable or edit an existing '.
+ 'one.');
+ }
+
+}
diff --git a/src/applications/harbormaster/editor/HarbormasterBuildEditEngine.php b/src/applications/harbormaster/editor/HarbormasterBuildEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/harbormaster/editor/HarbormasterBuildEditEngine.php
@@ -0,0 +1,87 @@
+<?php
+
+final class HarbormasterBuildEditEngine
+ extends PhabricatorEditEngine {
+
+ const ENGINECONST = 'harbormaster.build';
+
+ public function isEngineConfigurable() {
+ return false;
+ }
+
+ public function getEngineName() {
+ return pht('Harbormaster Builds');
+ }
+
+ public function getSummaryHeader() {
+ return pht('Edit Harbormaster Build Configurations');
+ }
+
+ public function getSummaryText() {
+ return pht('This engine is used to edit Harbormaster builds.');
+ }
+
+ public function getEngineApplicationClass() {
+ return 'PhabricatorHarbormasterApplication';
+ }
+
+ protected function newEditableObject() {
+ $viewer = $this->getViewer();
+ return HarbormasterBuild::initializeNewBuild($viewer);
+ }
+
+ protected function newObjectQuery() {
+ return new HarbormasterBuildQuery();
+ }
+
+ protected function newEditableObjectForDocumentation() {
+ $object = new DifferentialRevision();
+
+ $buildable = id(new HarbormasterBuildable())
+ ->attachBuildableObject($object);
+
+ return $this->newEditableObject()
+ ->attachBuildable($buildable);
+ }
+
+ protected function getObjectCreateTitleText($object) {
+ return pht('Create Build');
+ }
+
+ protected function getObjectCreateButtonText($object) {
+ return pht('Create Build');
+ }
+
+ protected function getObjectEditTitleText($object) {
+ return pht('Edit Build: %s', $object->getName());
+ }
+
+ protected function getObjectEditShortText($object) {
+ return pht('Edit Build');
+ }
+
+ protected function getObjectCreateShortText() {
+ return pht('Create Build');
+ }
+
+ protected function getObjectName() {
+ return pht('Build');
+ }
+
+ protected function getEditorURI() {
+ return '/harbormaster/build/edit/';
+ }
+
+ protected function getObjectCreateCancelURI($object) {
+ return '/harbormaster/';
+ }
+
+ protected function getObjectViewURI($object) {
+ return $object->getURI();
+ }
+
+ protected function buildCustomEditFields($object) {
+ return array();
+ }
+
+}
diff --git a/src/applications/harbormaster/editor/HarbormasterBuildableEditEngine.php b/src/applications/harbormaster/editor/HarbormasterBuildableEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/harbormaster/editor/HarbormasterBuildableEditEngine.php
@@ -0,0 +1,84 @@
+<?php
+
+final class HarbormasterBuildableEditEngine
+ extends PhabricatorEditEngine {
+
+ const ENGINECONST = 'harbormaster.buildable';
+
+ public function isEngineConfigurable() {
+ return false;
+ }
+
+ public function getEngineName() {
+ return pht('Harbormaster Buildables');
+ }
+
+ public function getSummaryHeader() {
+ return pht('Edit Harbormaster Buildable Configurations');
+ }
+
+ public function getSummaryText() {
+ return pht('This engine is used to edit Harbormaster buildables.');
+ }
+
+ public function getEngineApplicationClass() {
+ return 'PhabricatorHarbormasterApplication';
+ }
+
+ protected function newEditableObject() {
+ $viewer = $this->getViewer();
+ return HarbormasterBuildable::initializeNewBuildable($viewer);
+ }
+
+ protected function newObjectQuery() {
+ return new HarbormasterBuildableQuery();
+ }
+
+ protected function newEditableObjectForDocumentation() {
+ $object = new DifferentialRevision();
+
+ return $this->newEditableObject()
+ ->attachBuildableObject($object);
+ }
+
+ protected function getObjectCreateTitleText($object) {
+ return pht('Create Buildable');
+ }
+
+ protected function getObjectCreateButtonText($object) {
+ return pht('Create Buildable');
+ }
+
+ protected function getObjectEditTitleText($object) {
+ return pht('Edit Buildable: %s', $object->getName());
+ }
+
+ protected function getObjectEditShortText($object) {
+ return pht('Edit Buildable');
+ }
+
+ protected function getObjectCreateShortText() {
+ return pht('Create Buildable');
+ }
+
+ protected function getObjectName() {
+ return pht('Buildable');
+ }
+
+ protected function getEditorURI() {
+ return '/harbormaster/buildable/edit/';
+ }
+
+ protected function getObjectCreateCancelURI($object) {
+ return '/harbormaster/';
+ }
+
+ protected function getObjectViewURI($object) {
+ return $object->getURI();
+ }
+
+ protected function buildCustomEditFields($object) {
+ return array();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
May 27 2024, 6:10 AM (7 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289415
Default Alt Text
D21695.diff (8 KB)

Event Timeline