Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
69b530a
Basic implementation of resource and collection handling
nickvergessen Sep 14, 2018
65a9ab4
Add a controller with the most important methods
nickvergessen Oct 16, 2018
136d2c3
Provider functionality
nickvergessen Oct 17, 2018
5dfc56e
Allow to create collections
nickvergessen Oct 18, 2018
702dcfb
Make names mandatory
nickvergessen Oct 24, 2018
ab4b293
Insert new collection into database
juliusknorr Oct 29, 2018
d6aae43
Move files_sharing to webpack
juliusknorr Jan 17, 2019
322f7c3
Add vue app for collaboration resources
juliusknorr Jan 17, 2019
a72a6d7
Adjust parameter names on createCollectionOnResource
juliusknorr Jan 22, 2019
7a4b2db
Add javascript API for collaboration resources
juliusknorr Oct 22, 2018
51057c5
Use proper public javascript methods
juliusknorr Jan 23, 2019
7843b8b
Adjust OCP.Collaboration
juliusknorr Jan 23, 2019
555afff
Make sure we query the node before fetching the name
juliusknorr Jan 23, 2019
88aa3de
Add iconClass to resources
juliusknorr Jan 23, 2019
d85e3e3
Allow apps to register resource providers
juliusknorr Jan 24, 2019
506eb88
Only call resource provider if type matches
juliusknorr Jan 24, 2019
3777df6
Add link to resource provider
juliusknorr Jan 24, 2019
53ac9bd
Implement frontend for search/rename
juliusknorr Jan 29, 2019
e404ce7
Implement search and rename in backend
juliusknorr Jan 29, 2019
d1a4856
Add eslint settings and reorganize files
juliusknorr Jan 31, 2019
31340b8
Add icon for resource type and icons for folder/file
juliusknorr Jan 31, 2019
dee6f7f
Fix doc blocks
nickvergessen Feb 7, 2019
ece471d
Start implementing access cache
nickvergessen Feb 7, 2019
59c92a7
Further work on the access cache
nickvergessen Feb 11, 2019
a8a5472
Improve searchCollections()
nickvergessen Feb 11, 2019
c8c59e6
Make sure the results are always sorted the same
nickvergessen Feb 11, 2019
103298e
Use icon-close to remove resources
juliusknorr Feb 14, 2019
fd434da
Fix SQL statement and provider method call
juliusknorr Feb 16, 2019
cab704f
Merge webpack into main one
juliusknorr Feb 20, 2019
7207a77
Use nextcloud-vue-collections library
juliusknorr Feb 21, 2019
43c8d0c
Add default value, because null does not trigger unique-key
nickvergessen Feb 22, 2019
eecd932
Also check the access to collections on preparing
nickvergessen Feb 22, 2019
995cad0
Cache the access manually too
nickvergessen Feb 22, 2019
901f1d4
Don't throw on UniqueConstraintViolationException since a written val…
nickvergessen Feb 22, 2019
30dff37
Add invalidation methods to the interface
nickvergessen Feb 22, 2019
1a73cab
Fix doc block
nickvergessen Feb 22, 2019
066238a
Fix unused variable $access
nickvergessen Feb 22, 2019
4113505
Also cache the resource type because it is part of the identifier
nickvergessen Feb 22, 2019
55ae7fa
Invalidate the cache when a share is updated
nickvergessen Feb 22, 2019
01b4db6
Add dispatcher events to User and Group objects
nickvergessen Feb 22, 2019
752276f
Add a listener for the events
nickvergessen Feb 22, 2019
fdfe984
Register providers via class names
nickvergessen Feb 22, 2019
1c4436d
Access for a collection can only become true
nickvergessen Feb 22, 2019
55cd9ea
Update autoloader
nickvergessen Feb 22, 2019
37e6488
Use nextcloud-vue-collection 0.1.2
juliusknorr Feb 22, 2019
ba2b542
Listen to IUser::postDelete
juliusknorr Feb 24, 2019
6ee7286
Fix tests
juliusknorr Feb 24, 2019
c778032
Properly handle null as ownerId if file system access is denied by ac…
juliusknorr Feb 24, 2019
e5162fb
Fix tests
juliusknorr Feb 24, 2019
f0e50bc
Fetch node and filename also if access cache was used
juliusknorr Feb 24, 2019
0c32b21
Fix files_external tests
nickvergessen Feb 25, 2019
48f34b8
Add bundled files
juliusknorr Feb 21, 2019
ca0624d
Remove unneeded files
juliusknorr Mar 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix doc blocks
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and juliusknorr committed Mar 1, 2019
commit dee6f7f61f0f0d1827ed0555f199d7bce67e67b6
6 changes: 3 additions & 3 deletions core/Controller/CollaborationResourcesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function listCollection(int $collectionId): DataResponse {
/**
* @NoAdminRequired
*
* @param int $collectionId
* @param string $filter
* @return DataResponse
*/
public function searchCollections(string $filter): DataResponse {
Expand Down Expand Up @@ -179,8 +179,8 @@ public function getCollectionsByResource(string $resourceType, string $resourceI
/**
* @NoAdminRequired
*
* @param string $resourceType
* @param string $resourceId
* @param string $baseResourceType
* @param string $baseResourceId
* @param string $name
* @return DataResponse
*/
Expand Down
12 changes: 6 additions & 6 deletions lib/private/Collaboration/Resources/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ public function __construct(

/**
* @return int
* @since 15.0.0
* @since 16.0.0
*/
public function getId(): int {
return $this->id;
}

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getName(): string {
return $this->name;
}

/**
* @return IResource[]
* @since 15.0.0
* @since 16.0.0
*/
public function getResources(): array {
if (empty($this->resources)) {
Expand All @@ -104,7 +104,7 @@ public function getResources(): array {
*
* @param IResource $resource
* @throws ResourceException when the resource is already part of the collection
* @since 15.0.0
* @since 16.0.0
*/
public function addResource(IResource $resource) {
array_map(function(IResource $r) use ($resource) {
Expand Down Expand Up @@ -134,7 +134,7 @@ public function addResource(IResource $resource) {
* Removes a resource from a collection
*
* @param IResource $resource
* @since 15.0.0
* @since 16.0.0
*/
public function removeResource(IResource $resource) {
$this->resources = array_filter($this->resources, function(IResource $r) use ($resource) {
Expand All @@ -158,7 +158,7 @@ public function removeResource(IResource $resource) {
*
* @param IUser $user
* @return bool
* @since 15.0.0
* @since 16.0.0
*/
public function canAccess(IUser $user = null): bool {
foreach ($this->getResources() as $resource) {
Expand Down
28 changes: 15 additions & 13 deletions lib/private/Collaboration/Resources/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(IDBConnection $connection) {
* @param int $id
* @return ICollection
* @throws CollectionException when the collection could not be found
* @since 15.0.0
* @since 16.0.0
*/
public function getCollection(int $id): ICollection {
$query = $this->connection->getQueryBuilder();
Expand All @@ -68,10 +68,12 @@ public function getCollection(int $id): ICollection {
}

/**
* @param int $id
* @return ICollection
* @throws CollectionException when the collection could not be found
* @since 15.0.0
* @param IUser $user
* @param string $filter
* @param int $limit
* @param int $start
* @return ICollection[]
* @since 16.0.0
*/
public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array {
$query = $this->connection->getQueryBuilder();
Expand Down Expand Up @@ -99,7 +101,7 @@ public function searchCollections(IUser $user, string $filter, int $limit = 50,
/**
* @param string $name
* @return ICollection
* @since 15.0.0
* @since 16.0.0
*/
public function newCollection(string $name): ICollection {
$query = $this->connection->getQueryBuilder();
Expand All @@ -116,15 +118,15 @@ public function newCollection(string $name): ICollection {
* @param string $type
* @param string $id
* @return IResource
* @since 15.0.0
* @since 16.0.0
*/
public function getResource(string $type, string $id): IResource {
return new Resource($this, $this->connection, $type, $id);
}

/**
* @return IProvider[]
* @since 15.0.0
* @since 16.0.0
*/
public function getProviders(): array {
return $this->providers;
Expand All @@ -135,7 +137,7 @@ public function getProviders(): array {
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getName(IResource $resource): string {
foreach ($this->getProviders() as $provider) {
Expand Down Expand Up @@ -174,7 +176,7 @@ public function getIconClass(IResource $resource): string {
* @param IResource $resource
* @param IUser $user
* @return bool
* @since 15.0.0
* @since 16.0.0
*/
public function canAccess(IResource $resource, IUser $user = null): bool {
foreach ($this->getProviders() as $provider) {
Expand Down Expand Up @@ -203,7 +205,7 @@ public function registerResourceProvider(IProvider $provider): void {
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getType(): string {
return '';
Expand All @@ -214,7 +216,7 @@ public function getType(): string {
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getLink(IResource $resource): string {
foreach ($this->getProviders() as $provider) {
Expand All @@ -232,7 +234,7 @@ public function getLink(IResource $resource): string {
/**
* @param string $name
* @return ICollection
* @since 15.0.0
* @since 16.0.0
*/
public function renameCollection(int $id, string $name): ICollection {
$query = $this->connection->getQueryBuilder();
Expand Down
12 changes: 6 additions & 6 deletions lib/private/Collaboration/Resources/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ public function __construct(

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getType(): string {
return $this->type;
}

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getId(): string {
return $this->id;
}

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getName(): string {
if ($this->name === null) {
Expand All @@ -95,7 +95,7 @@ public function getName(): string {

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getIconClass(): string {
if ($this->iconClass === null) {
Expand All @@ -119,15 +119,15 @@ public function getLink(): string {
*
* @param IUser $user
* @return bool
* @since 15.0.0
* @since 16.0.0
*/
public function canAccess(IUser $user = null): bool {
return $this->manager->canAccess($this, $user);
}

/**
* @return ICollection[]
* @since 15.0.0
* @since 16.0.0
*/
public function getCollections(): array {
$collections = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

namespace OCP\Collaboration\Resources;


/**
* @since 16.0.0
*/
class CollectionException extends \RuntimeException {

}
14 changes: 7 additions & 7 deletions lib/public/Collaboration/Resources/ICollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@
use OCP\IUser;

/**
* @since 15.0.0
* @since 16.0.0
*/
interface ICollection {

/**
* @return int
* @since 15.0.0
* @since 16.0.0
*/
public function getId(): int;

/**
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getName(): string;

/**
* @return IResource[]
* @since 15.0.0
* @since 16.0.0
*/
public function getResources(): array;

Expand All @@ -52,15 +52,15 @@ public function getResources(): array;
*
* @param IResource $resource
* @throws ResourceException when the resource is already part of the collection
* @since 15.0.0
* @since 16.0.0
*/
public function addResource(IResource $resource);

/**
* Removes a resource from a collection
*
* @param IResource $resource
* @since 15.0.0
* @since 16.0.0
*/
public function removeResource(IResource $resource);

Expand All @@ -69,7 +69,7 @@ public function removeResource(IResource $resource);
*
* @param IUser $user
* @return bool
* @since 15.0.0
* @since 16.0.0
*/
public function canAccess(IUser $user = null): bool;
}
10 changes: 5 additions & 5 deletions lib/public/Collaboration/Resources/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@
namespace OCP\Collaboration\Resources;

/**
* @since 15.0.0
* @since 16.0.0
*/
interface IManager extends IProvider {

/**
* @param int $id
* @return ICollection
* @throws CollectionException when the collection could not be found
* @since 15.0.0
* @since 16.0.0
*/
public function getCollection(int $id): ICollection;

/**
* @param string $name
* @return ICollection
* @since 15.0.0
* @since 16.0.0
*/
public function newCollection(string $name): ICollection;


/**
* @param string $name
* @return ICollection
* @since 15.0.0
* @since 16.0.0
*/
public function renameCollection(int $id, string $name): ICollection;

/**
* @param string $type
* @param string $id
* @return IResource
* @since 15.0.0
* @since 16.0.0
*/
public function getResource(string $type, string $id): IResource;

Expand Down
13 changes: 8 additions & 5 deletions lib/public/Collaboration/Resources/IProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@

use OCP\IUser;

/**
* @since 16.0.0
*/
interface IProvider {

/**
* Get the type of a resource
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getType(): string;

Expand All @@ -40,7 +43,7 @@ public function getType(): string;
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getName(IResource $resource): string;

Expand All @@ -49,7 +52,7 @@ public function getName(IResource $resource): string;
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getIconClass(IResource $resource): string;

Expand All @@ -58,7 +61,7 @@ public function getIconClass(IResource $resource): string;
*
* @param IResource $resource
* @return string
* @since 15.0.0
* @since 16.0.0
*/
public function getLink(IResource $resource): string;

Expand All @@ -68,7 +71,7 @@ public function getLink(IResource $resource): string;
* @param IResource $resource
* @param IUser $user
* @return bool
* @since 15.0.0
* @since 16.0.0
*/
public function canAccess(IResource $resource, IUser $user = null): bool;

Expand Down
Loading