namespace OCA\DAV\SystemTag;
use Sabre\DAV\Exception\NotFound;
-use Sabre\DAV\Exception\MethodNotAllowed;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\ISystemTagManager;
* Sets up the node, expects a full path name
*
* @param ISystemTag $tag system tag
+ * @param string $objectId
+ * @param string $objectType
+ * @param ISystemTagManager $tagManager
+ * @param ISystemTagObjectMapper $tagMapper
*/
public function __construct(
ISystemTag $tag,
namespace OCA\DAV\SystemTag;
+use OCP\SystemTag\TagAlreadyExistsException;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\Exception\Conflict;
* Sets up the node, expects a full path name
*
* @param ISystemTag $tag system tag
+ * @param ISystemTagManager $tagManager
*/
public function __construct(ISystemTag $tag, ISystemTagManager $tagManager) {
$this->tag = $tag;
* @param string $name new tag name
* @param bool $userVisible user visible
* @param bool $userAssignable user assignable
+ * @throws Conflict
*/
public function update($name, $userVisible, $userAssignable) {
try {
*/
namespace OCA\DAV\SystemTag;
+use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\PropFind;
use Sabre\DAV\PropPatch;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\UnsupportedMediaType;
use Sabre\DAV\Exception\Conflict;
-use OCA\DAV\SystemTag\SystemTagNode;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\TagAlreadyExistsException;
+use Sabre\HTTP\RequestInterface;
+use Sabre\HTTP\ResponseInterface;
class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
*/
public function initialize(\Sabre\DAV\Server $server) {
- $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc';
+ $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$server->protectedProperties[] = self::ID_PROPERTYNAME;
*
* @param string $data
* @param string $contentType content type of the data
- *
* @return ISystemTag newly created system tag
*
- * @throws UnsupportedMediaType if the content type is not supported
* @throws BadRequest if a field was missing
+ * @throws Conflict
+ * @throws UnsupportedMediaType if the content type is not supported
*/
private function createTag($data, $contentType = 'application/json') {
if ($contentType === 'application/json') {
self::USERVISIBLE_PROPERTYNAME,
self::USERASSIGNABLE_PROPERTYNAME,
], function($props) use ($path) {
- $node = $this->tree->getNodeForPath($path);
+ $node = $this->server->tree->getNodeForPath($path);
if (!($node instanceof SystemTagNode)) {
return;
}
- $tag = $node->getTag();
+ $tag = $node->getSystemTag();
$name = $tag->getName();
- $userVisible = $tag->getUserVisible();
- $userAssignable = $tag->getUserAssignable();
+ $userVisible = $tag->isUserVisible();
+ $userAssignable = $tag->isUserAssignable();
if (isset($props[self::DISPLAYNAME_PROPERTYNAME])) {
$name = $props[self::DISPLAYNAME_PROPERTYNAME];
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\TagNotFoundException;
-use OC\SystemTag\SystemTag;
class SystemTagsByIdCollection implements ICollection {
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
-use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\ICollection;
use OCP\SystemTag\ISystemTagObjectMapper;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\TagNotFoundException;
-use OC\SystemTag\SystemTag;
/**
* Collection containing tags by object id
namespace OCA\DAV\SystemTag;
use Sabre\DAV\Exception\Forbidden;
-use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\ICollection;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTagObjectMapper;
-use OCP\SystemTag\ISystemTag;
-use OCP\SystemTag\TagNotFoundException;
-use OC\SystemTag\SystemTag;
/**
* Collection containing object ids by object type
namespace OCA\DAV\SystemTag;
+use OCP\SystemTag\ISystemTagManager;
+use OCP\SystemTag\ISystemTagObjectMapper;
+use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\SimpleCollection;
class SystemTagsRelationsCollection extends SimpleCollection {