Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2689315
D25693.1734731625.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
D25693.1734731625.diff
View Options
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
@@ -5615,6 +5615,7 @@
'PhrictionDocumentDatasource' => 'applications/phriction/typeahead/PhrictionDocumentDatasource.php',
'PhrictionDocumentDeleteTransaction' => 'applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php',
'PhrictionDocumentDraftTransaction' => 'applications/phriction/xaction/PhrictionDocumentDraftTransaction.php',
+ 'PhrictionDocumentEditConduitAPIMethod' => 'applications/phriction/conduit/PhrictionDocumentEditConduitAPIMethod.php',
'PhrictionDocumentEditEngine' => 'applications/phriction/editor/PhrictionDocumentEditEngine.php',
'PhrictionDocumentEditTransaction' => 'applications/phriction/xaction/PhrictionDocumentEditTransaction.php',
'PhrictionDocumentFerretEngine' => 'applications/phriction/search/PhrictionDocumentFerretEngine.php',
@@ -12510,6 +12511,7 @@
'PhrictionDocumentDatasource' => 'PhabricatorTypeaheadDatasource',
'PhrictionDocumentDeleteTransaction' => 'PhrictionDocumentVersionTransaction',
'PhrictionDocumentDraftTransaction' => 'PhrictionDocumentEditTransaction',
+ 'PhrictionDocumentEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'PhrictionDocumentEditEngine' => 'PhabricatorEditEngine',
'PhrictionDocumentEditTransaction' => 'PhrictionDocumentVersionTransaction',
'PhrictionDocumentFerretEngine' => 'PhabricatorFerretEngine',
diff --git a/src/applications/phriction/conduit/PhrictionDocumentEditConduitAPIMethod.php b/src/applications/phriction/conduit/PhrictionDocumentEditConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phriction/conduit/PhrictionDocumentEditConduitAPIMethod.php
@@ -0,0 +1,19 @@
+<?php
+
+final class PhrictionDocumentEditConduitAPIMethod
+ extends PhabricatorEditEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'phriction.document.edit';
+ }
+
+ public function newEditEngine() {
+ return new PhrictionDocumentEditEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht(
+ 'Apply transactions to edit an existing phriction document.');
+ }
+
+}
diff --git a/src/applications/phriction/phid/PhrictionDocumentPHIDType.php b/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
--- a/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
+++ b/src/applications/phriction/phid/PhrictionDocumentPHIDType.php
@@ -47,4 +47,26 @@
}
}
+ public function canLoadNamedObject($name) {
+ return preg_match('/.*\/$/', $name);
+ }
+
+ public function loadNamedObjects(
+ PhabricatorObjectQuery $query,
+ array $names) {
+ $objects = id(new PhrictionDocumentQuery())
+ ->setViewer($query->getViewer())
+ ->withSlugs($names)
+ ->execute();
+
+ $results = array();
+ foreach ($objects as $id => $object) {
+ foreach ($names as $name) {
+ $results[$name] = $object;
+ }
+ }
+
+ return $results;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 21:53 (17 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016342
Default Alt Text
D25693.1734731625.diff (3 KB)
Attached To
Mode
D25693: Conduit API: allow phriction.edit to modify viewPolicy and editPolicy
Attached
Detach File
Event Timeline
Log In to Comment