summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php4
-rw-r--r--lib/composer/composer/autoload_static.php4
-rw-r--r--lib/l10n/cs.js22
-rw-r--r--lib/l10n/cs.json22
-rw-r--r--lib/private/DirectEditing/Token.php2
-rw-r--r--lib/private/Files/Node/File.php15
-rw-r--r--lib/private/Files/Node/Node.php23
-rw-r--r--lib/private/Files/View.php24
-rw-r--r--lib/public/Files/File.php13
-rw-r--r--lib/public/Files/Node.php29
-rw-r--r--lib/public/WorkflowEngine/EntityContext/IDisplayName.php41
-rw-r--r--lib/public/WorkflowEngine/EntityContext/IDisplayText.php47
-rw-r--r--lib/public/WorkflowEngine/EntityContext/IIcon.php42
-rw-r--r--lib/public/WorkflowEngine/EntityContext/IUrl.php41
-rw-r--r--lib/public/WorkflowEngine/IEntity.php8
-rw-r--r--lib/public/WorkflowEngine/IRuleMatcher.php40
-rw-r--r--lib/versioncheck.php6
17 files changed, 326 insertions, 57 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 900a03a0f35..cd6b4ca1a85 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -452,6 +452,10 @@ return array(
'OCP\\User\\Backend\\ISetPasswordBackend' => $baseDir . '/lib/public/User/Backend/ISetPasswordBackend.php',
'OCP\\User\\Events\\PostLoginEvent' => $baseDir . '/lib/public/User/Events/PostLoginEvent.php',
'OCP\\Util' => $baseDir . '/lib/public/Util.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IDisplayName' => $baseDir . '/lib/public/WorkflowEngine/EntityContext/IDisplayName.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IDisplayText' => $baseDir . '/lib/public/WorkflowEngine/EntityContext/IDisplayText.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IIcon' => $baseDir . '/lib/public/WorkflowEngine/EntityContext/IIcon.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IUrl' => $baseDir . '/lib/public/WorkflowEngine/EntityContext/IUrl.php',
'OCP\\WorkflowEngine\\GenericEntityEvent' => $baseDir . '/lib/public/WorkflowEngine/GenericEntityEvent.php',
'OCP\\WorkflowEngine\\ICheck' => $baseDir . '/lib/public/WorkflowEngine/ICheck.php',
'OCP\\WorkflowEngine\\IComplexOperation' => $baseDir . '/lib/public/WorkflowEngine/IComplexOperation.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 84532fabf5f..7fae2d92c37 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -481,6 +481,10 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\User\\Backend\\ISetPasswordBackend' => __DIR__ . '/../../..' . '/lib/public/User/Backend/ISetPasswordBackend.php',
'OCP\\User\\Events\\PostLoginEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PostLoginEvent.php',
'OCP\\Util' => __DIR__ . '/../../..' . '/lib/public/Util.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IDisplayName' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/EntityContext/IDisplayName.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IDisplayText' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/EntityContext/IDisplayText.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IIcon' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/EntityContext/IIcon.php',
+ 'OCP\\WorkflowEngine\\EntityContext\\IUrl' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/EntityContext/IUrl.php',
'OCP\\WorkflowEngine\\GenericEntityEvent' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/GenericEntityEvent.php',
'OCP\\WorkflowEngine\\ICheck' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/ICheck.php',
'OCP\\WorkflowEngine\\IComplexOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IComplexOperation.php',
diff --git a/lib/l10n/cs.js b/lib/l10n/cs.js
index f0cbeedec00..7493f63e6f2 100644
--- a/lib/l10n/cs.js
+++ b/lib/l10n/cs.js
@@ -158,18 +158,18 @@ OC.L10N.register(
"October" : "říjen",
"November" : "listopad",
"December" : "prosinec",
- "Jan." : "led",
- "Feb." : "úno",
- "Mar." : "bře",
- "Apr." : "dub",
- "May." : "kvě",
- "Jun." : "červen",
- "Jul." : "čeč",
- "Aug." : "srp",
- "Sep." : "září",
- "Oct." : "říj",
+ "Jan." : "led.",
+ "Feb." : "úno.",
+ "Mar." : "bře.",
+ "Apr." : "dub.",
+ "May." : "kvě.",
+ "Jun." : "čvn.",
+ "Jul." : "čvc.",
+ "Aug." : "srp.",
+ "Sep." : "zář.",
+ "Oct." : "říj.",
"Nov." : "list.",
- "Dec." : "pro",
+ "Dec." : "pro.",
"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-'\"" : "Pouze následující znaky jsou povoleny pro uživatelské jméno: „a-z“, „A-Z“, „0-9“, a „_.@-'“",
"A valid username must be provided" : "Je třeba zadat platné uživatelské jméno",
"Username contains whitespace at the beginning or at the end" : "Uživatelské jméno obsahuje mezery na svém začátku nebo konci",
diff --git a/lib/l10n/cs.json b/lib/l10n/cs.json
index a94fa799e73..322b3bc62f2 100644
--- a/lib/l10n/cs.json
+++ b/lib/l10n/cs.json
@@ -156,18 +156,18 @@
"October" : "říjen",
"November" : "listopad",
"December" : "prosinec",
- "Jan." : "led",
- "Feb." : "úno",
- "Mar." : "bře",
- "Apr." : "dub",
- "May." : "kvě",
- "Jun." : "červen",
- "Jul." : "čeč",
- "Aug." : "srp",
- "Sep." : "září",
- "Oct." : "říj",
+ "Jan." : "led.",
+ "Feb." : "úno.",
+ "Mar." : "bře.",
+ "Apr." : "dub.",
+ "May." : "kvě.",
+ "Jun." : "čvn.",
+ "Jul." : "čvc.",
+ "Aug." : "srp.",
+ "Sep." : "zář.",
+ "Oct." : "říj.",
"Nov." : "list.",
- "Dec." : "pro",
+ "Dec." : "pro.",
"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-'\"" : "Pouze následující znaky jsou povoleny pro uživatelské jméno: „a-z“, „A-Z“, „0-9“, a „_.@-'“",
"A valid username must be provided" : "Je třeba zadat platné uživatelské jméno",
"Username contains whitespace at the beginning or at the end" : "Uživatelské jméno obsahuje mezery na svém začátku nebo konci",
diff --git a/lib/private/DirectEditing/Token.php b/lib/private/DirectEditing/Token.php
index 946699900b7..148621a2cf3 100644
--- a/lib/private/DirectEditing/Token.php
+++ b/lib/private/DirectEditing/Token.php
@@ -62,7 +62,7 @@ class Token implements IToken {
}
public function hasBeenAccessed(): bool {
- return $this->data['accessed'] === '1';
+ return (bool) $this->data['accessed'];
}
public function getEditor(): string {
diff --git a/lib/private/Files/Node/File.php b/lib/private/Files/Node/File.php
index b504c7a29da..e4669f70709 100644
--- a/lib/private/Files/Node/File.php
+++ b/lib/private/Files/Node/File.php
@@ -28,6 +28,7 @@ namespace OC\Files\Node;
use OCP\Files\GenericFileException;
use OCP\Files\NotPermittedException;
+use OCP\Lock\LockedException;
class File extends Node implements \OCP\Files\File {
/**
@@ -42,7 +43,8 @@ class File extends Node implements \OCP\Files\File {
/**
* @return string
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
*/
public function getContent() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_READ)) {
@@ -57,8 +59,9 @@ class File extends Node implements \OCP\Files\File {
/**
* @param string|resource $data
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
* @throws \OCP\Files\GenericFileException
+ * @throws LockedException
*/
public function putContent($data) {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
@@ -76,7 +79,8 @@ class File extends Node implements \OCP\Files\File {
/**
* @param string $mode
* @return resource
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
*/
public function fopen($mode) {
$preHooks = array();
@@ -113,6 +117,11 @@ class File extends Node implements \OCP\Files\File {
}
}
+ /**
+ * @throws NotPermittedException
+ * @throws \OCP\Files\InvalidPathException
+ * @throws \OCP\Files\NotFoundException
+ */
public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
$this->sendHooks(array('preDelete'));
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 95d16cf5c99..7f50524f28d 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -33,6 +33,7 @@ use OCP\Files\FileInfo;
use OCP\Files\InvalidPathException;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
+use OCP\Lock\LockedException;
use Symfony\Component\EventDispatcher\GenericEvent;
// FIXME: this class really should be abstract
@@ -75,6 +76,7 @@ class Node implements \OCP\Files\Node {
*
* @param string $path path
* @return string non-existing node class
+ * @throws \Exception
*/
protected function createNonExistingNode($path) {
throw new \Exception('Must be implemented by subclasses');
@@ -117,6 +119,8 @@ class Node implements \OCP\Files\Node {
/**
* @param int $permissions
* @return bool
+ * @throws InvalidPathException
+ * @throws NotFoundException
*/
protected function checkPermissions($permissions) {
return ($this->getPermissions() & $permissions) === $permissions;
@@ -127,7 +131,9 @@ class Node implements \OCP\Files\Node {
/**
* @param int $mtime
- * @throws \OCP\Files\NotPermittedException
+ * @throws InvalidPathException
+ * @throws NotFoundException
+ * @throws NotPermittedException
*/
public function touch($mtime = null) {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
@@ -366,7 +372,7 @@ class Node implements \OCP\Files\Node {
/**
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
*/
public function lock($type) {
$this->view->lockFile($this->path, $type);
@@ -374,7 +380,7 @@ class Node implements \OCP\Files\Node {
/**
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
*/
public function changeLock($type) {
$this->view->changeLock($this->path, $type);
@@ -382,7 +388,7 @@ class Node implements \OCP\Files\Node {
/**
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
*/
public function unlock($type) {
$this->view->unlockFile($this->path, $type);
@@ -390,8 +396,10 @@ class Node implements \OCP\Files\Node {
/**
* @param string $targetPath
- * @throws \OCP\Files\NotPermittedException if copy not allowed or failed
* @return \OC\Files\Node\Node
+ * @throws InvalidPathException
+ * @throws NotFoundException
+ * @throws NotPermittedException if copy not allowed or failed
*/
public function copy($targetPath) {
$targetPath = $this->normalizePath($targetPath);
@@ -414,8 +422,11 @@ class Node implements \OCP\Files\Node {
/**
* @param string $targetPath
- * @throws \OCP\Files\NotPermittedException if move not allowed or failed
* @return \OC\Files\Node\Node
+ * @throws InvalidPathException
+ * @throws NotFoundException
+ * @throws NotPermittedException if move not allowed or failed
+ * @throws LockedException
*/
public function move($targetPath) {
$targetPath = $this->normalizePath($targetPath);
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 4f4c4b90f2c..ed962bde1a4 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -589,6 +589,7 @@ class View {
/**
* @param string $path
* @return mixed
+ * @throws LockedException
*/
public function file_get_contents($path) {
return $this->basicOperation('file_get_contents', $path, array('read'));
@@ -640,7 +641,7 @@ class View {
* @param string $path
* @param string|resource $data
* @return bool|mixed
- * @throws \Exception
+ * @throws LockedException
*/
public function file_put_contents($path, $data) {
if (is_resource($data)) { //not having to deal with streams in file_put_contents makes life easier
@@ -739,6 +740,7 @@ class View {
* @param string $path2 target path
*
* @return bool|mixed
+ * @throws LockedException
*/
public function rename($path1, $path2) {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
@@ -962,6 +964,7 @@ class View {
* @param string $path
* @param string $mode 'r' or 'w'
* @return resource
+ * @throws LockedException
*/
public function fopen($path, $mode) {
$mode = str_replace('b', '', $mode); // the binary flag is a windows only feature which we do not support
@@ -1117,7 +1120,7 @@ class View {
* @param array $hooks (optional)
* @param mixed $extraParam (optional)
* @return mixed
- * @throws \Exception
+ * @throws LockedException
*
* This method takes requests for basic filesystem functions (e.g. reading & writing
* files), processes hooks and proxies, sanitises paths, and finally passes them on to
@@ -1919,7 +1922,7 @@ class View {
* @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage
*
* @return bool False if the path is excluded from locking, true otherwise
- * @throws \OCP\Lock\LockedException if the path is already locked
+ * @throws LockedException if the path is already locked
*/
private function lockPath($path, $type, $lockMountPoint = false) {
$absolutePath = $this->getAbsolutePath($path);
@@ -1939,9 +1942,9 @@ class View {
$this->lockingProvider
);
}
- } catch (\OCP\Lock\LockedException $e) {
+ } catch (LockedException $e) {
// rethrow with the a human-readable path
- throw new \OCP\Lock\LockedException(
+ throw new LockedException(
$this->getPathRelativeToFiles($absolutePath),
$e
);
@@ -1959,7 +1962,7 @@ class View {
* @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage
*
* @return bool False if the path is excluded from locking, true otherwise
- * @throws \OCP\Lock\LockedException if the path is already locked
+ * @throws LockedException if the path is already locked
*/
public function changeLock($path, $type, $lockMountPoint = false) {
$path = Filesystem::normalizePath($path);
@@ -1980,15 +1983,15 @@ class View {
$this->lockingProvider
);
}
- } catch (\OCP\Lock\LockedException $e) {
+ } catch (LockedException $e) {
try {
// rethrow with the a human-readable path
- throw new \OCP\Lock\LockedException(
+ throw new LockedException(
$this->getPathRelativeToFiles($absolutePath),
$e
);
} catch (\InvalidArgumentException $e) {
- throw new \OCP\Lock\LockedException(
+ throw new LockedException(
$absolutePath,
$e
);
@@ -2007,6 +2010,7 @@ class View {
* @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage
*
* @return bool False if the path is excluded from locking, true otherwise
+ * @throws LockedException
*/
private function unlockPath($path, $type, $lockMountPoint = false) {
$absolutePath = $this->getAbsolutePath($path);
@@ -2038,6 +2042,7 @@ class View {
* @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage
*
* @return bool False if the path is excluded from locking, true otherwise
+ * @throws LockedException
*/
public function lockFile($path, $type, $lockMountPoint = false) {
$absolutePath = $this->getAbsolutePath($path);
@@ -2064,6 +2069,7 @@ class View {
* @param bool $lockMountPoint true to lock the mount point, false to lock the attached mount/storage
*
* @return bool False if the path is excluded from locking, true otherwise
+ * @throws LockedException
*/
public function unlockFile($path, $type, $lockMountPoint = false) {
$absolutePath = $this->getAbsolutePath($path);
diff --git a/lib/public/Files/File.php b/lib/public/Files/File.php
index 1fe01cfb29a..bd3b3da0df2 100644
--- a/lib/public/Files/File.php
+++ b/lib/public/Files/File.php
@@ -33,6 +33,8 @@
namespace OCP\Files;
+use OCP\Lock\LockedException;
+
/**
* Interface File
*
@@ -44,7 +46,8 @@ interface File extends Node {
* Get the content of the file as string
*
* @return string
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
* @since 6.0.0
*/
public function getContent();
@@ -53,8 +56,9 @@ interface File extends Node {
* Write to the file from string data
*
* @param string|resource $data
- * @throws \OCP\Files\NotPermittedException
- * @throws \OCP\Files\GenericFileException
+ * @throws NotPermittedException
+ * @throws GenericFileException
+ * @throws LockedException
* @since 6.0.0
*/
public function putContent($data);
@@ -72,7 +76,8 @@ interface File extends Node {
*
* @param string $mode
* @return resource
- * @throws \OCP\Files\NotPermittedException
+ * @throws NotPermittedException
+ * @throws LockedException
* @since 6.0.0
*/
public function fopen($mode);
diff --git a/lib/public/Files/Node.php b/lib/public/Files/Node.php
index 4468b680014..af7d9454ca6 100644
--- a/lib/public/Files/Node.php
+++ b/lib/public/Files/Node.php
@@ -34,6 +34,8 @@
namespace OCP\Files;
+use OCP\Lock\LockedException;
+
/**
* Interface Node
*
@@ -45,15 +47,22 @@ interface Node extends FileInfo {
* Move the file or folder to a new location
*
* @param string $targetPath the absolute target path
- * @throws \OCP\Files\NotPermittedException
- * @return \OCP\Files\Node
+ * @return Node
+ * @throws NotFoundException
+ * @throws NotPermittedException if move not allowed or failed
+ * @throws LockedException
+ * @throws InvalidPathException
* @since 6.0.0
*/
public function move($targetPath);
/**
* Delete the file or folder
+ *
* @return void
+ * @throws NotPermittedException
+ * @throws InvalidPathException
+ * @throws NotFoundException
* @since 6.0.0
*/
public function delete();
@@ -62,7 +71,7 @@ interface Node extends FileInfo {
* Cope the file or folder to a new location
*
* @param string $targetPath the absolute target path
- * @return \OCP\Files\Node
+ * @return Node
* @since 6.0.0
*/
public function copy($targetPath);
@@ -72,7 +81,9 @@ interface Node extends FileInfo {
* If $mtime is omitted the current time will be used
*
* @param int $mtime (optional) modified date as unix timestamp
- * @throws \OCP\Files\NotPermittedException
+ * @throws InvalidPathException
+ * @throws NotFoundException
+ * @throws NotPermittedException
* @return void
* @since 6.0.0
*/
@@ -81,8 +92,8 @@ interface Node extends FileInfo {
/**
* Get the storage backend the file or folder is stored on
*
- * @return \OCP\Files\Storage
- * @throws \OCP\Files\NotFoundException
+ * @return Storage
+ * @throws NotFoundException
* @since 6.0.0
*/
public function getStorage();
@@ -247,7 +258,7 @@ interface Node extends FileInfo {
* any filesystem operation will automatically acquire the relevant locks for that operation.
*
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
* @since 9.1.0
*/
public function lock($type);
@@ -262,7 +273,7 @@ interface Node extends FileInfo {
* Note that this is also the case if no existing lock exists for the file.
*
* @param int $targetType \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
* @since 9.1.0
*/
public function changeLock($targetType);
@@ -275,7 +286,7 @@ interface Node extends FileInfo {
* Note that this method will not give any sort of error when trying to free a lock that doesn't exist.
*
* @param int $type \OCP\Lock\ILockingProvider::LOCK_SHARED or \OCP\Lock\ILockingProvider::LOCK_EXCLUSIVE
- * @throws \OCP\Lock\LockedException
+ * @throws LockedException
* @since 9.1.0
*/
public function unlock($type);
diff --git a/lib/public/WorkflowEngine/EntityContext/IDisplayName.php b/lib/public/WorkflowEngine/EntityContext/IDisplayName.php
new file mode 100644
index 00000000000..eeaf7887d5a
--- /dev/null
+++ b/lib/public/WorkflowEngine/EntityContext/IDisplayName.php
@@ -0,0 +1,41 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\WorkflowEngine\EntityContext;
+
+/**
+ * Interface IDisplayName
+ *
+ * @package OCP\WorkflowEngine\EntityContext
+ *
+ * @since 18.0.0
+ */
+interface IDisplayName {
+ /**
+ * returns the end user facing name of the object related to the entity
+ *
+ * @since 18.0.0
+ */
+ public function getDisplayName(): string;
+}
diff --git a/lib/public/WorkflowEngine/EntityContext/IDisplayText.php b/lib/public/WorkflowEngine/EntityContext/IDisplayText.php
new file mode 100644
index 00000000000..5e74171883a
--- /dev/null
+++ b/lib/public/WorkflowEngine/EntityContext/IDisplayText.php
@@ -0,0 +1,47 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\WorkflowEngine\EntityContext;
+
+/**
+ * Interface IDisplayText
+ *
+ * @package OCP\WorkflowEngine\EntityContext
+ *
+ * @since 18.0.0
+ */
+interface IDisplayText {
+
+ /**
+ * returns translated text used for display to the end user. For instance,
+ * it can describe the event in a human readable way.
+ *
+ * The entity may react to a verbosity level that is provided. With the
+ * basic level, 0, it would return brief information, and more with higher
+ * numbers. All information shall be shown at a level of 3.
+ *
+ * @since 18.0.0
+ */
+ public function getDisplayText(int $verbosity = 0): string;
+}
diff --git a/lib/public/WorkflowEngine/EntityContext/IIcon.php b/lib/public/WorkflowEngine/EntityContext/IIcon.php
new file mode 100644
index 00000000000..cde340c9931
--- /dev/null
+++ b/lib/public/WorkflowEngine/EntityContext/IIcon.php
@@ -0,0 +1,42 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\WorkflowEngine\EntityContext;
+
+/**
+ * Interface IIcon
+ *
+ * @package OCP\WorkflowEngine\EntityContext
+ *
+ * @since 18.0.0
+ */
+interface IIcon {
+ /**
+ * returns a URL to an icon that is related to the entity, for instance
+ * a group icon for groups.
+ *
+ * @since 18.0.0
+ */
+ public function getIconUrl(): string;
+}
diff --git a/lib/public/WorkflowEngine/EntityContext/IUrl.php b/lib/public/WorkflowEngine/EntityContext/IUrl.php
new file mode 100644
index 00000000000..a847dfaad05
--- /dev/null
+++ b/lib/public/WorkflowEngine/EntityContext/IUrl.php
@@ -0,0 +1,41 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\WorkflowEngine\EntityContext;
+
+/**
+ * Interface IUrl
+ *
+ * @package OCP\WorkflowEngine\EntityContext
+ *
+ * @since 18.0.0
+ */
+interface IUrl {
+ /**
+ * returns a URL that is related to the entity, e.g. the link to a share
+ *
+ * @since 18.0.0
+ */
+ public function getUrl(): string;
+}
diff --git a/lib/public/WorkflowEngine/IEntity.php b/lib/public/WorkflowEngine/IEntity.php
index b8205600498..47e2f102199 100644
--- a/lib/public/WorkflowEngine/IEntity.php
+++ b/lib/public/WorkflowEngine/IEntity.php
@@ -74,4 +74,12 @@ interface IEntity {
*/
public function prepareRuleMatcher(IRuleMatcher $ruleMatcher, string $eventName, Event $event): void;
+ /**
+ * returns whether the provided user id is allowed to run a flow against
+ * the known context
+ *
+ * @since 18.0.0
+ */
+ public function isLegitimatedForUserId(string $userId): bool;
+
}
diff --git a/lib/public/WorkflowEngine/IRuleMatcher.php b/lib/public/WorkflowEngine/IRuleMatcher.php
index 5569800edb7..28abaa56137 100644
--- a/lib/public/WorkflowEngine/IRuleMatcher.php
+++ b/lib/public/WorkflowEngine/IRuleMatcher.php
@@ -24,6 +24,8 @@ declare(strict_types=1);
namespace OCP\WorkflowEngine;
+use RuntimeException;
+
/**
* Class IRuleMatcher
*
@@ -33,7 +35,45 @@ namespace OCP\WorkflowEngine;
*/
interface IRuleMatcher extends IFileCheck {
/**
+ * This method is left for backwards compatibility and easier porting of
+ * apps. Please use 'getFlows' instead (and setOperation if you implement
+ * an IComplexOperation).
+ *
* @since 18.0.0
+ * @deprecated 18.0.0
*/
public function getMatchingOperations(string $class, bool $returnFirstMatchingOperationOnly = true): array;
+
+ /**
+ * @throws RuntimeException
+ * @since 18.0.0
+ */
+ public function getFlows(bool $returnFirstMatchingOperationOnly = true): array;
+
+ /**
+ * this method can only be called once and is typically called by the
+ * Flow engine, unless for IComplexOperations.
+ *
+ * @throws RuntimeException
+ * @since 18.0.0
+ */
+ public function setOperation(IOperation $operation): void;
+
+ /**
+ * this method can only be called once and is typically called by the
+ * Flow engine, unless for IComplexOperations.
+ *
+ * @throws RuntimeException
+ * @since 18.0.0
+ */
+ public function setEntity(IEntity $entity): void;
+
+ /**
+ * returns the entity which might provide more information, depending on
+ * the interfaces it implements
+ *
+ * @return IEntity
+ * @since 18.0.0
+ */
+ public function getEntity(): IEntity;
}
diff --git a/lib/versioncheck.php b/lib/versioncheck.php
index b130480f823..004a4b717f0 100644
--- a/lib/versioncheck.php
+++ b/lib/versioncheck.php
@@ -1,9 +1,9 @@
<?php
-// Show warning if a PHP version below 7.1 is used,
-if (version_compare(PHP_VERSION, '7.1') === -1) {
+// Show warning if a PHP version below 7.2 is used,
+if (version_compare(PHP_VERSION, '7.2') === -1) {
http_response_code(500);
- echo 'This version of Nextcloud requires at least PHP 7.1<br/>';
+ echo 'This version of Nextcloud requires at least PHP 7.2<br/>';
echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
exit(-1);
}