Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14785633
D15546.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
20 KB
Referenced Files
None
Subscribers
None
D15546.diff
View Options
diff --git a/resources/sql/autopatches/20160329.nuance.01.requestor.sql b/resources/sql/autopatches/20160329.nuance.01.requestor.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160329.nuance.01.requestor.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestor;
diff --git a/resources/sql/autopatches/20160329.nuance.02.requestorsource.sql b/resources/sql/autopatches/20160329.nuance.02.requestorsource.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160329.nuance.02.requestorsource.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestorsource;
diff --git a/resources/sql/autopatches/20160329.nuance.03.requestorxaction.sql b/resources/sql/autopatches/20160329.nuance.03.requestorxaction.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160329.nuance.03.requestorxaction.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestortransaction;
diff --git a/resources/sql/autopatches/20160329.nuance.04.requestorcomment.sql b/resources/sql/autopatches/20160329.nuance.04.requestorcomment.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20160329.nuance.04.requestorcomment.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS {$NAMESPACE}_nuance.nuance_requestortransaction_comment;
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
@@ -1479,16 +1479,6 @@
'NuanceQueueTransactionComment' => 'applications/nuance/storage/NuanceQueueTransactionComment.php',
'NuanceQueueTransactionQuery' => 'applications/nuance/query/NuanceQueueTransactionQuery.php',
'NuanceQueueViewController' => 'applications/nuance/controller/NuanceQueueViewController.php',
- 'NuanceRequestor' => 'applications/nuance/storage/NuanceRequestor.php',
- 'NuanceRequestorEditController' => 'applications/nuance/controller/NuanceRequestorEditController.php',
- 'NuanceRequestorEditor' => 'applications/nuance/editor/NuanceRequestorEditor.php',
- 'NuanceRequestorPHIDType' => 'applications/nuance/phid/NuanceRequestorPHIDType.php',
- 'NuanceRequestorQuery' => 'applications/nuance/query/NuanceRequestorQuery.php',
- 'NuanceRequestorSource' => 'applications/nuance/storage/NuanceRequestorSource.php',
- 'NuanceRequestorTransaction' => 'applications/nuance/storage/NuanceRequestorTransaction.php',
- 'NuanceRequestorTransactionComment' => 'applications/nuance/storage/NuanceRequestorTransactionComment.php',
- 'NuanceRequestorTransactionQuery' => 'applications/nuance/query/NuanceRequestorTransactionQuery.php',
- 'NuanceRequestorViewController' => 'applications/nuance/controller/NuanceRequestorViewController.php',
'NuanceSchemaSpec' => 'applications/nuance/storage/NuanceSchemaSpec.php',
'NuanceSource' => 'applications/nuance/storage/NuanceSource.php',
'NuanceSourceActionController' => 'applications/nuance/controller/NuanceSourceActionController.php',
@@ -5797,20 +5787,6 @@
'NuanceQueueTransactionComment' => 'PhabricatorApplicationTransactionComment',
'NuanceQueueTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'NuanceQueueViewController' => 'NuanceQueueController',
- 'NuanceRequestor' => array(
- 'NuanceDAO',
- 'PhabricatorPolicyInterface',
- 'PhabricatorApplicationTransactionInterface',
- ),
- 'NuanceRequestorEditController' => 'NuanceController',
- 'NuanceRequestorEditor' => 'PhabricatorApplicationTransactionEditor',
- 'NuanceRequestorPHIDType' => 'PhabricatorPHIDType',
- 'NuanceRequestorQuery' => 'NuanceQuery',
- 'NuanceRequestorSource' => 'NuanceDAO',
- 'NuanceRequestorTransaction' => 'NuanceTransaction',
- 'NuanceRequestorTransactionComment' => 'PhabricatorApplicationTransactionComment',
- 'NuanceRequestorTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'NuanceRequestorViewController' => 'NuanceController',
'NuanceSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'NuanceSource' => array(
'NuanceDAO',
diff --git a/src/applications/nuance/application/PhabricatorNuanceApplication.php b/src/applications/nuance/application/PhabricatorNuanceApplication.php
--- a/src/applications/nuance/application/PhabricatorNuanceApplication.php
+++ b/src/applications/nuance/application/PhabricatorNuanceApplication.php
@@ -56,11 +56,6 @@
$this->getEditRoutePattern('edit/') => 'NuanceQueueEditController',
'view/(?P<id>[1-9]\d*)/' => 'NuanceQueueViewController',
),
- 'requestor/' => array(
- 'view/(?P<id>[1-9]\d*)/' => 'NuanceRequestorViewController',
- 'edit/(?P<id>[1-9]\d*)/' => 'NuanceRequestorEditController',
- 'new/' => 'NuanceRequestorEditController',
- ),
),
'/action/' => array(
'(?P<id>[1-9]\d*)/(?P<path>.*)' => 'NuanceSourceActionController',
diff --git a/src/applications/nuance/controller/NuanceRequestorEditController.php b/src/applications/nuance/controller/NuanceRequestorEditController.php
deleted file mode 100644
--- a/src/applications/nuance/controller/NuanceRequestorEditController.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-final class NuanceRequestorEditController extends NuanceController {
-
- public function handleRequest(AphrontRequest $request) {
- $viewer = $request->getViewer();
- $id = $request->getURIData('id');
-
- if (!$id) {
- $requestor = new NuanceRequestor();
-
- } else {
- $requestor = id(new NuanceRequestorQuery())
- ->setViewer($viewer)
- ->withIDs(array($id))
- ->executeOne();
- }
-
- if (!$requestor) {
- return new Aphront404Response();
- }
-
- $crumbs = $this->buildApplicationCrumbs();
- $title = pht('TODO');
-
- return $this->buildApplicationPage(
- $crumbs,
- array(
- 'title' => $title,
- ));
- }
-
-}
diff --git a/src/applications/nuance/controller/NuanceRequestorViewController.php b/src/applications/nuance/controller/NuanceRequestorViewController.php
deleted file mode 100644
--- a/src/applications/nuance/controller/NuanceRequestorViewController.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-final class NuanceRequestorViewController extends NuanceController {
-
- public function handleRequest(AphrontRequest $request) {
- $viewer = $request->getViewer();
- $id = $request->getURIData('id');
-
- $requestor = id(new NuanceRequestorQuery())
- ->setViewer($viewer)
- ->withIDs(array($id))
- ->executeOne();
-
- if (!$requestor) {
- return new Aphront404Response();
- }
-
- $crumbs = $this->buildApplicationCrumbs();
- $title = 'TODO';
-
- return $this->buildApplicationPage(
- $crumbs,
- array(
- 'title' => $title,
- ));
- }
-}
diff --git a/src/applications/nuance/editor/NuanceRequestorEditor.php b/src/applications/nuance/editor/NuanceRequestorEditor.php
deleted file mode 100644
--- a/src/applications/nuance/editor/NuanceRequestorEditor.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-final class NuanceRequestorEditor
- extends PhabricatorApplicationTransactionEditor {
-
- public function getEditorApplicationClass() {
- return 'PhabricatorNuanceApplication';
- }
-
- public function getEditorObjectsDescription() {
- return pht('Nuance Requestors');
- }
-
- public function getTransactionTypes() {
- $types = parent::getTransactionTypes();
-
- $types[] = NuanceRequestorTransaction::TYPE_PROPERTY;
-
- $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
- $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
-
- return $types;
- }
-
- protected function getCustomTransactionOldValue(
- PhabricatorLiskDAO $object,
- PhabricatorApplicationTransaction $xaction) {
-
- switch ($xaction->getTransactionType()) {
- case NuanceRequestorTransaction::TYPE_PROPERTY:
- $key = $xaction->getMetadataValue(
- NuanceRequestorTransaction::PROPERTY_KEY);
- return $object->getNuanceProperty($key);
- }
-
- return parent::getCustomTransactionOldValue($object, $xaction);
- }
-
- protected function getCustomTransactionNewValue(
- PhabricatorLiskDAO $object,
- PhabricatorApplicationTransaction $xaction) {
-
- switch ($xaction->getTransactionType()) {
- case NuanceRequestorTransaction::TYPE_PROPERTY:
- return $xaction->getNewValue();
- }
-
- return parent::getCustomTransactionNewValue($object, $xaction);
- }
-
- protected function applyCustomInternalTransaction(
- PhabricatorLiskDAO $object,
- PhabricatorApplicationTransaction $xaction) {
-
- switch ($xaction->getTransactionType()) {
- case NuanceRequestorTransaction::TYPE_PROPERTY:
- $key = $xaction->getMetadataValue(
- NuanceRequestorTransaction::PROPERTY_KEY);
- $object->setNuanceProperty($key, $xaction->getNewValue());
- break;
- }
- }
-
- protected function applyCustomExternalTransaction(
- PhabricatorLiskDAO $object,
- PhabricatorApplicationTransaction $xaction) {
-
- switch ($xaction->getTransactionType()) {
- case NuanceRequestorTransaction::TYPE_PROPERTY:
- return;
- }
-
- return parent::applyCustomExternalTransaction($object, $xaction);
- }
-}
diff --git a/src/applications/nuance/phid/NuanceRequestorPHIDType.php b/src/applications/nuance/phid/NuanceRequestorPHIDType.php
deleted file mode 100644
--- a/src/applications/nuance/phid/NuanceRequestorPHIDType.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-final class NuanceRequestorPHIDType extends PhabricatorPHIDType {
-
- const TYPECONST = 'NUAR';
-
- public function getTypeName() {
- return pht('Requestor');
- }
-
- public function newObject() {
- return new NuanceRequestor();
- }
-
- public function getPHIDTypeApplicationClass() {
- return 'PhabricatorNuanceApplication';
- }
-
- protected function buildQueryForObjects(
- PhabricatorObjectQuery $query,
- array $phids) {
-
- return id(new NuanceRequestorQuery())
- ->withPHIDs($phids);
- }
-
- public function loadHandles(
- PhabricatorHandleQuery $query,
- array $handles,
- array $objects) {
-
- $viewer = $query->getViewer();
- foreach ($handles as $phid => $handle) {
- $requestor = $objects[$phid];
-
- // TODO: This is currently useless and should be far more informative.
- $handle->setName(pht('Requestor %d', $requestor->getID()));
-
- $handle->setURI($requestor->getURI());
- }
- }
-
-}
diff --git a/src/applications/nuance/query/NuanceRequestorQuery.php b/src/applications/nuance/query/NuanceRequestorQuery.php
deleted file mode 100644
--- a/src/applications/nuance/query/NuanceRequestorQuery.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-final class NuanceRequestorQuery
- extends NuanceQuery {
-
- private $ids;
- private $phids;
-
- public function withIDs(array $ids) {
- $this->ids = $ids;
- return $this;
- }
-
- public function withPHIDs(array $phids) {
- $this->phids = $phids;
- return $this;
- }
-
- public function newObject() {
- return new NuanceRequestor();
- }
-
- protected function loadPage() {
- return $this->loadStandardPage($this->newObject());
- }
-
- protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
- $where = parent::buildWhereClauseParts($conn);
-
- if ($this->ids !== null) {
- $where[] = qsprintf(
- $conn,
- 'id IN (%Ld)',
- $this->ids);
- }
-
- if ($this->phids !== null) {
- $where[] = qsprintf(
- $conn,
- 'phid IN (%Ls)',
- $this->phids);
- }
-
- return $where;
- }
-
-}
diff --git a/src/applications/nuance/query/NuanceRequestorTransactionQuery.php b/src/applications/nuance/query/NuanceRequestorTransactionQuery.php
deleted file mode 100644
--- a/src/applications/nuance/query/NuanceRequestorTransactionQuery.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-final class NuanceRequestorTransactionQuery
- extends PhabricatorApplicationTransactionQuery {
-
- public function getTemplateApplicationTransaction() {
- return new NuanceRequestorTransaction();
- }
-
-}
diff --git a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
--- a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
+++ b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
@@ -38,12 +38,7 @@
$content_source = PhabricatorContentSource::newFromRequest($request);
- $requestor = NuanceRequestor::newFromPhabricatorUser(
- $viewer,
- $content_source);
-
$item = $this->newItemFromProperties(
- $requestor,
$properties,
$content_source);
diff --git a/src/applications/nuance/source/NuanceSourceDefinition.php b/src/applications/nuance/source/NuanceSourceDefinition.php
--- a/src/applications/nuance/source/NuanceSourceDefinition.php
+++ b/src/applications/nuance/source/NuanceSourceDefinition.php
@@ -149,7 +149,6 @@
}
protected function newItemFromProperties(
- NuanceRequestor $requestor,
array $properties,
PhabricatorContentSource $content_source) {
@@ -166,10 +165,6 @@
->setTransactionType(NuanceItemTransaction::TYPE_SOURCE)
->setNewValue($source->getPHID());
- $xactions[] = id(new NuanceItemTransaction())
- ->setTransactionType(NuanceItemTransaction::TYPE_REQUESTOR)
- ->setNewValue($requestor->getPHID());
-
// TODO: Eventually, apply real routing rules. For now, just put everything
// in the default queue for the source.
$xactions[] = id(new NuanceItemTransaction())
@@ -185,7 +180,6 @@
$editor = id(new NuanceItemEditor())
->setActor($actor)
- ->setActingAsPHID($requestor->getActingAsPHID())
->setContentSource($content_source);
$editor->applyTransactions($item, $xactions);
diff --git a/src/applications/nuance/storage/NuanceItem.php b/src/applications/nuance/storage/NuanceItem.php
--- a/src/applications/nuance/storage/NuanceItem.php
+++ b/src/applications/nuance/storage/NuanceItem.php
@@ -87,14 +87,6 @@
return '/nuance/item/view/'.$this->getID().'/';
}
- public function getRequestor() {
- return $this->assertAttached($this->requestor);
- }
-
- public function attachRequestor(NuanceRequestor $requestor) {
- return $this->requestor = $requestor;
- }
-
public function getSource() {
return $this->assertAttached($this->source);
}
diff --git a/src/applications/nuance/storage/NuanceRequestor.php b/src/applications/nuance/storage/NuanceRequestor.php
deleted file mode 100644
--- a/src/applications/nuance/storage/NuanceRequestor.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-
-final class NuanceRequestor
- extends NuanceDAO
- implements
- PhabricatorPolicyInterface,
- PhabricatorApplicationTransactionInterface {
-
- protected $data = array();
-
- protected function getConfiguration() {
- return array(
- self::CONFIG_AUX_PHID => true,
- self::CONFIG_SERIALIZATION => array(
- 'data' => self::SERIALIZATION_JSON,
- ),
- ) + parent::getConfiguration();
- }
-
- public function generatePHID() {
- return PhabricatorPHID::generateNewPHID(
- NuanceRequestorPHIDType::TYPECONST);
- }
-
- public static function initializeNewRequestor() {
- return new NuanceRequestor();
- }
-
- public function getURI() {
- return '/nuance/requestor/view/'.$this->getID().'/';
- }
-
- public function getPhabricatorUserPHID() {
- return idx($this->getData(), 'phabricatorUserPHID');
- }
-
- public function getActingAsPHID() {
- $user_phid = $this->getPhabricatorUserPHID();
- if ($user_phid) {
- return $user_phid;
- }
-
- return id(new PhabricatorNuanceApplication())->getPHID();
- }
-
- public static function newFromPhabricatorUser(
- PhabricatorUser $viewer,
- PhabricatorContentSource $content_source) {
-
- // TODO: This is real sketchy and creates a new requestor every time. It
- // shouldn't do that.
-
- $requestor = self::initializeNewRequestor();
-
- $xactions = array();
-
- $properties = array(
- 'phabricatorUserPHID' => $viewer->getPHID(),
- );
-
- foreach ($properties as $key => $value) {
- $xactions[] = id(new NuanceRequestorTransaction())
- ->setTransactionType(NuanceRequestorTransaction::TYPE_PROPERTY)
- ->setMetadataValue(NuanceRequestorTransaction::PROPERTY_KEY, $key)
- ->setNewValue($value);
- }
-
- $editor = id(new NuanceRequestorEditor())
- ->setActor($viewer)
- ->setContentSource($content_source);
-
- $editor->applyTransactions($requestor, $xactions);
-
- return $requestor;
- }
-
- public function getNuanceProperty($key, $default = null) {
- return idx($this->data, $key, $default);
- }
-
- public function setNuanceProperty($key, $value) {
- $this->data[$key] = $value;
- return $this;
- }
-
-
-/* -( PhabricatorPolicyInterface )----------------------------------------- */
-
-
- public function getCapabilities() {
- return array(
- PhabricatorPolicyCapability::CAN_VIEW,
- PhabricatorPolicyCapability::CAN_EDIT,
- );
- }
-
- public function getPolicy($capability) {
- switch ($capability) {
- case PhabricatorPolicyCapability::CAN_VIEW:
- return PhabricatorPolicies::POLICY_USER;
- case PhabricatorPolicyCapability::CAN_EDIT:
- return PhabricatorPolicies::POLICY_USER;
- }
- }
-
- public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
- return false;
- }
-
- public function describeAutomaticCapability($capability) {
- return null;
- }
-
-
-/* -( PhabricatorApplicationTransactionInterface )------------------------- */
-
-
- public function getApplicationTransactionEditor() {
- return new NuanceRequestorEditor();
- }
-
- public function getApplicationTransactionObject() {
- return $this;
- }
-
- public function getApplicationTransactionTemplate() {
- return new NuanceRequestorTransaction();
- }
-
- public function willRenderTimeline(
- PhabricatorApplicationTransactionView $timeline,
- AphrontRequest $request) {
-
- return $timeline;
- }
-
-}
diff --git a/src/applications/nuance/storage/NuanceRequestorSource.php b/src/applications/nuance/storage/NuanceRequestorSource.php
deleted file mode 100644
--- a/src/applications/nuance/storage/NuanceRequestorSource.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-final class NuanceRequestorSource
- extends NuanceDAO {
-
- protected $requestorPHID;
- protected $sourcePHID;
- protected $sourceKey;
- protected $data;
-
- protected function getConfiguration() {
- return array(
- self::CONFIG_SERIALIZATION => array(
- 'data' => self::SERIALIZATION_JSON,
- ),
- self::CONFIG_COLUMN_SCHEMA => array(
- 'sourceKey' => 'text128',
- ),
- self::CONFIG_KEY_SCHEMA => array(
- 'key_source_key' => array(
- 'columns' => array('sourcePHID', 'sourceKey'),
- 'unique' => true,
- ),
- 'key_requestor' => array(
- 'columns' => array('requestorPHID', 'id'),
- ),
- 'key_source' => array(
- 'columns' => array('sourcePHID', 'id'),
- ),
- ),
- ) + parent::getConfiguration();
- }
-
-}
diff --git a/src/applications/nuance/storage/NuanceRequestorTransaction.php b/src/applications/nuance/storage/NuanceRequestorTransaction.php
deleted file mode 100644
--- a/src/applications/nuance/storage/NuanceRequestorTransaction.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-final class NuanceRequestorTransaction
- extends NuanceTransaction {
-
- const PROPERTY_KEY = 'property.key';
-
- const TYPE_PROPERTY = 'nuance.requestor.property';
-
- public function getApplicationTransactionType() {
- return NuanceRequestorPHIDType::TYPECONST;
- }
-
- public function getApplicationTransactionCommentObject() {
- return new NuanceRequestorTransactionComment();
- }
-}
diff --git a/src/applications/nuance/storage/NuanceRequestorTransactionComment.php b/src/applications/nuance/storage/NuanceRequestorTransactionComment.php
deleted file mode 100644
--- a/src/applications/nuance/storage/NuanceRequestorTransactionComment.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-final class NuanceRequestorTransactionComment
- extends PhabricatorApplicationTransactionComment {
-
- public function getApplicationTransactionObject() {
- return new NuanceRequestorTransaction();
- }
-
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 12:32 PM (15 h, 7 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7050611
Default Alt Text
D15546.diff (20 KB)
Attached To
Mode
D15546: Remove dedicated storage for NuanceRequestor
Attached
Detach File
Event Timeline
Log In to Comment