Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Oct 16, 2018

Mockup/spec

#11015 (comment)

Implements #11015

UI

peek 2019-01-31 11-47

ToDo

Backend

  • Allow apps to register their provider classes
  • Add iconClass to Resources
  • Limit calling resource providers by the resource type
  • Add Link to resource
  • Renaming collections
  • Serach for existing collections
  • x] Properly iterate over database until we find some collections

Frontend

  • Create new collections in the files sidebar
  • List existing collections and their resources
  • Add to existing collections
  • Remove resources from collections
  • Add readableName to Resources (so a resource of type files is translatable and can be used in the ui like "Link to a file")
  • Rename collections

Documentation

Registering resources in the frontend

OCP.Collaboration.registerType('files', {
    // This function is called when the user selects the entry "Link to a file" in the multiselect input
	action: () => {
		return new Promise((resolve, reject) => {
			OC.dialogs.filepicker('Link to a file', function (f) {
				const client = OC.Files.getClient();
				client.getFileInfo(f).then((status, fileInfo) => {
					resolve(fileInfo.id)
				}, () => {
					reject()
				})
			}, false);
		})
	},
	typeString: 'file',
    typeIconClass: 'icon-files-dark'
});

Registering resource providers in the backend

  • Implement OCP\Collaboration\Resources\IProvider
  • ... TBD

@nickvergessen nickvergessen added the 2. developing Work in progress label Oct 16, 2018
@nickvergessen nickvergessen added this to the Nextcloud 15 milestone Oct 16, 2018
@nickvergessen nickvergessen force-pushed the feature/11015/collaboration-resources branch from ab2abfd to c38362e Compare October 18, 2018 12:39
@MorrisJobke MorrisJobke mentioned this pull request Nov 6, 2018
29 tasks
@MorrisJobke
Copy link
Member

@nickvergessen Is this ready by tomorrow evening? Could I help you somehow to get this in?

@MorrisJobke MorrisJobke modified the milestones: Nextcloud 15, Nextcloud 16 Nov 7, 2018
@nickvergessen nickvergessen force-pushed the feature/11015/collaboration-resources branch from 61623b0 to 877ee5f Compare January 16, 2019 14:18
@juliusknorr juliusknorr force-pushed the feature/11015/collaboration-resources branch 2 times, most recently from ee8da2e to 6b47198 Compare January 29, 2019 15:13
@juliusknorr juliusknorr force-pushed the feature/11015/collaboration-resources branch from 6b47198 to 9f68171 Compare January 31, 2019 10:27
@juliusknorr
Copy link
Member

I've added a screencast of the current UI to the first post: #11871 (comment)

Please have a look @nextcloud/designers

@nickvergessen Please have a look as well 😉

Apart from that I think this is a good start for this feature.

@nickvergessen
Copy link
Member Author

Conflicts

@nickvergessen
Copy link
Member Author

Access cache should be working now for most things.
If you search the first time and a lot of collections with resources where created already, it is still bad, but we can't really help that.

@jancborchardt
Copy link
Member

@juliushaertl looking good generally, nice work! :) The icon-delete would better be icon-close X since it does not delete the file but only removes the connection?

@juliusknorr
Copy link
Member

@nickvergessen There seem to be some issues with the query when fetching collections / creating collections. The frontend is already working for testing btw, just make sure to run npm install and npm run build for the core bundle as well as in apps/files_sharing/

{"reqId":"QF8IBqEeO2jUbM1L99OQ","level":3,"time":"2019-02-14T13:45:30+00:00","remoteAddr":"192.168.21.1","user":"admin","app":"no app in context","method":"POST","url":"\/ocs\/v2.php\/collaboration\/resources\/collections\/1?format=json","message":{"Exception":"Doctrine\\DBAL\\Query\\QueryException","Message":"The given alias '`r`' is not part of any FROM or JOIN clause table. The currently registered aliases are: `*PREFIX*collres_collections`.","Code":0,"Trace":[{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":1179,"function":"unknownAlias","class":"Doctrine\\DBAL\\Query\\QueryException","type":"::","args":["`r`",["`*PREFIX*collres_collections`"]]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":1165,"function":"verifyAllAliasesAreKnown","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[{"`*PREFIX*collres_collections`":true}]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":1125,"function":"getFromClauses","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":257,"function":"getSQLForSelect","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":219,"function":"getSQL","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php","line":214,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php","line":95,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php","line":62,"function":"getCollectionForUser","class":"OC\\Collaboration\\Resources\\Manager","type":"->","args":[1,{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php","line":113,"function":"getCollection","class":"OC\\Core\\Controller\\CollaborationResourcesController","type":"->","args":[1]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"addResource","class":"OC\\Core\\Controller\\CollaborationResourcesController","type":"->","args":[1,"files","134"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"addResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"addResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\CollaborationResourcesController","addResource",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"collectionId":"1","_route":"ocs.core.CollaborationResources.addResource"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"collectionId":"1","_route":"ocs.core.CollaborationResources.addResource"}]},{"file":"\/var\/www\/html\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"collectionId":"1","_route":"ocs.core.CollaborationResources.addResource"}]},{"file":"\/var\/www\/html\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/collaboration\/resources\/collections\/1"]},{"file":"\/var\/www\/html\/ocs\/v2.php","line":24,"args":["\/var\/www\/html\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryException.php","Line":38,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/72.0.3626.96 Safari\/537.36","version":"16.0.0.1"}
{"reqId":"QlzDeFbx0WInqXf2NDxY","level":3,"time":"2019-02-14T13:36:53+00:00","remoteAddr":"192.168.21.1","user":"admin","app":"no app in context","method":"GET","url":"\/ocs\/v2.php\/collaboration\/resources\/files\/129?format=json","message":{"Exception":"Doctrine\\DBAL\\Exception\\InvalidFieldNameException","Message":"An exception occurred while executing 'SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)' with params [\"admin\", \"files\", \"129\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause'","Code":0,"Trace":[{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php","line":184,"function":"convertException","class":"Doctrine\\DBAL\\Driver\\AbstractMySQLDriver","type":"->","args":["An exception occurred while executing 'SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)' with params [\"admin\", \"files\", \"129\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause'",{"errorInfo":["42S22",1054,"Unknown column 'r.id' in 'on clause'"],"xdebug_message":"<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )<\/span> Doctrine\\DBAL\\Driver\\PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause' in \/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php on line <i>143<\/i><\/th><\/tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack<\/th><\/tr>\n<tr><th align='center' bgcolor='#eeeeec'>#<\/th><th align='left' bgcolor='#eeeeec'>Time<\/th><th align='left' bgcolor='#eeeeec'>Memory<\/th><th align='left' bgcolor='#eeeeec'>Function<\/th><th align='left' bgcolor='#eeeeec'>Location<\/th><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>1<\/td><td bgcolor='#eeeeec' align='center'>0.0003<\/td><td bgcolor='#eeeeec' align='right'>362328<\/td><td bgcolor='#eeeeec'>{main}(  )<\/td><td title='\/var\/www\/html\/ocs\/v2.php' bgcolor='#eeeeec'>...\/v2.php<b>:<\/b>0<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>2<\/td><td bgcolor='#eeeeec' align='center'>0.0003<\/td><td bgcolor='#eeeeec' align='right'>363192<\/td><td bgcolor='#eeeeec'>require_once( <font color='#00bb00'>'\/var\/www\/html\/ocs\/v1.php'<\/font> )<\/td><td title='\/var\/www\/html\/ocs\/v2.php' bgcolor='#eeeeec'>...\/v2.php<b>:<\/b>24<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>3<\/td><td bgcolor='#eeeeec' align='center'>0.3872<\/td><td bgcolor='#eeeeec' align='right'>5994936<\/td><td bgcolor='#eeeeec'>OC\\Route\\Router->match(  )<\/td><td title='\/var\/www\/html\/ocs\/v1.php' bgcolor='#eeeeec'>...\/v1.php<b>:<\/b>82<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>4<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'><a href='http:\/\/www.php.net\/function.call-user-func:{\/var\/www\/html\/lib\/private\/Route\/Router.php:297}' target='_new'>call_user_func:{\/var\/www\/html\/lib\/private\/Route\/Router.php:297}<\/a>\n(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Route\/Router.php' bgcolor='#eeeeec'>...\/Router.php<b>:<\/b>297<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>5<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Route\/Router.php' bgcolor='#eeeeec'>...\/Router.php<b>:<\/b>297<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>6<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\App::main(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php' bgcolor='#eeeeec'>...\/RouteActionHandler.php<b>:<\/b>47<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>7<\/td><td bgcolor='#eeeeec' align='center'>0.4006<\/td><td bgcolor='#eeeeec' align='right'>6137624<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Http\\Dispatcher->dispatch(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/App.php' bgcolor='#eeeeec'>...\/App.php<b>:<\/b>118<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>8<\/td><td bgcolor='#eeeeec' align='center'>0.4081<\/td><td bgcolor='#eeeeec' align='right'>6184856<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Http\\Dispatcher->executeController(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php' bgcolor='#eeeeec'>...\/Dispatcher.php<b>:<\/b>99<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>9<\/td><td bgcolor='#eeeeec' align='center'>0.4082<\/td><td bgcolor='#eeeeec' align='right'>6185624<\/td><td bgcolor='#eeeeec'>OC\\Core\\Controller\\CollaborationResourcesController->getCollectionsByResource(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php' bgcolor='#eeeeec'>...\/Dispatcher.php<b>:<\/b>166<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>10<\/td><td bgcolor='#eeeeec' align='center'>0.4082<\/td><td bgcolor='#eeeeec' align='right'>6185624<\/td><td bgcolor='#eeeeec'>OC\\Collaboration\\Resources\\Manager->getResourceForUser(  )<\/td><td title='\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php' bgcolor='#eeeeec'>...\/CollaborationResourcesController.php<b>:<\/b>167<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>11<\/td><td bgcolor='#eeeeec' align='center'>0.4089<\/td><td bgcolor='#eeeeec' align='right'>6192336<\/td><td bgcolor='#eeeeec'>OC\\DB\\QueryBuilder\\QueryBuilder->execute(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php' bgcolor='#eeeeec'>...\/Manager.php<b>:<\/b>208<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>12<\/td><td bgcolor='#eeeeec' align='center'>0.4089<\/td><td bgcolor='#eeeeec' align='right'>6192336<\/td><td bgcolor='#eeeeec'>Doctrine\\DBAL\\Query\\QueryBuilder->execute(  )<\/td><td title='\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php' bgcolor='#eeeeec'>...\/QueryBuilder.php<b>:<\/b>214<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>13<\/td><td bgcolor='#eeeeec' align='center'>0.4090<\/td><td bgcolor='#eeeeec' align='right'>6192656<\/td><td bgcolor='#eeeeec'>OC\\DB\\Connection->executeQuery(  )<\/td><td title='\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php' bgcolor='#eeeeec'>...\/QueryBuilder.php<b>:<\/b>219<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>14<\/td><td bgcolor='#eeeeec' align='center'>0.4090<\/td><td bgcolor='#eeeeec' align='right'>6192976<\/td><td bgcolor='#eeeeec'>OC\\DB\\Connection->executeQuery(  )<\/td><td title='\/var\/www\/html\/lib\/private\/DB\/Connection.php' bgcolor='#eeeeec'>...\/Connection.php<b>:<\/b>195<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>15<\/td><td bgcolor='#eeeeec' align='center'>0.4092<\/td><td bgcolor='#eeeeec' align='right'>6205216<\/td><td bgcolor='#eeeeec'>Doctrine\\DBAL\\Driver\\PDOStatement->execute(  )<\/td><td title='\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php' bgcolor='#eeeeec'>...\/Connection.php<b>:<\/b>930<\/td><\/tr>\n","__class__":"Doctrine\\DBAL\\Driver\\PDOException"}]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php","line":158,"function":"wrapException","class":"Doctrine\\DBAL\\DBALException","type":"::","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDOMySql\\Driver"},{"errorInfo":["42S22",1054,"Unknown column 'r.id' in 'on clause'"],"xdebug_message":"<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )<\/span> Doctrine\\DBAL\\Driver\\PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause' in \/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php on line <i>143<\/i><\/th><\/tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack<\/th><\/tr>\n<tr><th align='center' bgcolor='#eeeeec'>#<\/th><th align='left' bgcolor='#eeeeec'>Time<\/th><th align='left' bgcolor='#eeeeec'>Memory<\/th><th align='left' bgcolor='#eeeeec'>Function<\/th><th align='left' bgcolor='#eeeeec'>Location<\/th><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>1<\/td><td bgcolor='#eeeeec' align='center'>0.0003<\/td><td bgcolor='#eeeeec' align='right'>362328<\/td><td bgcolor='#eeeeec'>{main}(  )<\/td><td title='\/var\/www\/html\/ocs\/v2.php' bgcolor='#eeeeec'>...\/v2.php<b>:<\/b>0<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>2<\/td><td bgcolor='#eeeeec' align='center'>0.0003<\/td><td bgcolor='#eeeeec' align='right'>363192<\/td><td bgcolor='#eeeeec'>require_once( <font color='#00bb00'>'\/var\/www\/html\/ocs\/v1.php'<\/font> )<\/td><td title='\/var\/www\/html\/ocs\/v2.php' bgcolor='#eeeeec'>...\/v2.php<b>:<\/b>24<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>3<\/td><td bgcolor='#eeeeec' align='center'>0.3872<\/td><td bgcolor='#eeeeec' align='right'>5994936<\/td><td bgcolor='#eeeeec'>OC\\Route\\Router->match(  )<\/td><td title='\/var\/www\/html\/ocs\/v1.php' bgcolor='#eeeeec'>...\/v1.php<b>:<\/b>82<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>4<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'><a href='http:\/\/www.php.net\/function.call-user-func:{\/var\/www\/html\/lib\/private\/Route\/Router.php:297}' target='_new'>call_user_func:{\/var\/www\/html\/lib\/private\/Route\/Router.php:297}<\/a>\n(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Route\/Router.php' bgcolor='#eeeeec'>...\/Router.php<b>:<\/b>297<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>5<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Route\/Router.php' bgcolor='#eeeeec'>...\/Router.php<b>:<\/b>297<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>6<\/td><td bgcolor='#eeeeec' align='center'>0.3882<\/td><td bgcolor='#eeeeec' align='right'>5997008<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\App::main(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php' bgcolor='#eeeeec'>...\/RouteActionHandler.php<b>:<\/b>47<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>7<\/td><td bgcolor='#eeeeec' align='center'>0.4006<\/td><td bgcolor='#eeeeec' align='right'>6137624<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Http\\Dispatcher->dispatch(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/App.php' bgcolor='#eeeeec'>...\/App.php<b>:<\/b>118<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>8<\/td><td bgcolor='#eeeeec' align='center'>0.4081<\/td><td bgcolor='#eeeeec' align='right'>6184856<\/td><td bgcolor='#eeeeec'>OC\\AppFramework\\Http\\Dispatcher->executeController(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php' bgcolor='#eeeeec'>...\/Dispatcher.php<b>:<\/b>99<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>9<\/td><td bgcolor='#eeeeec' align='center'>0.4082<\/td><td bgcolor='#eeeeec' align='right'>6185624<\/td><td bgcolor='#eeeeec'>OC\\Core\\Controller\\CollaborationResourcesController->getCollectionsByResource(  )<\/td><td title='\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php' bgcolor='#eeeeec'>...\/Dispatcher.php<b>:<\/b>166<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>10<\/td><td bgcolor='#eeeeec' align='center'>0.4082<\/td><td bgcolor='#eeeeec' align='right'>6185624<\/td><td bgcolor='#eeeeec'>OC\\Collaboration\\Resources\\Manager->getResourceForUser(  )<\/td><td title='\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php' bgcolor='#eeeeec'>...\/CollaborationResourcesController.php<b>:<\/b>167<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>11<\/td><td bgcolor='#eeeeec' align='center'>0.4089<\/td><td bgcolor='#eeeeec' align='right'>6192336<\/td><td bgcolor='#eeeeec'>OC\\DB\\QueryBuilder\\QueryBuilder->execute(  )<\/td><td title='\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php' bgcolor='#eeeeec'>...\/Manager.php<b>:<\/b>208<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>12<\/td><td bgcolor='#eeeeec' align='center'>0.4089<\/td><td bgcolor='#eeeeec' align='right'>6192336<\/td><td bgcolor='#eeeeec'>Doctrine\\DBAL\\Query\\QueryBuilder->execute(  )<\/td><td title='\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php' bgcolor='#eeeeec'>...\/QueryBuilder.php<b>:<\/b>214<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>13<\/td><td bgcolor='#eeeeec' align='center'>0.4090<\/td><td bgcolor='#eeeeec' align='right'>6192656<\/td><td bgcolor='#eeeeec'>OC\\DB\\Connection->executeQuery(  )<\/td><td title='\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php' bgcolor='#eeeeec'>...\/QueryBuilder.php<b>:<\/b>219<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>14<\/td><td bgcolor='#eeeeec' align='center'>0.4090<\/td><td bgcolor='#eeeeec' align='right'>6192976<\/td><td bgcolor='#eeeeec'>OC\\DB\\Connection->executeQuery(  )<\/td><td title='\/var\/www\/html\/lib\/private\/DB\/Connection.php' bgcolor='#eeeeec'>...\/Connection.php<b>:<\/b>195<\/td><\/tr>\n<tr><td bgcolor='#eeeeec' align='center'>15<\/td><td bgcolor='#eeeeec' align='center'>0.4092<\/td><td bgcolor='#eeeeec' align='right'>6205216<\/td><td bgcolor='#eeeeec'>Doctrine\\DBAL\\Driver\\PDOStatement->execute(  )<\/td><td title='\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php' bgcolor='#eeeeec'>...\/Connection.php<b>:<\/b>930<\/td><\/tr>\n","__class__":"Doctrine\\DBAL\\Driver\\PDOException"},"An exception occurred while executing 'SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)' with params [\"admin\", \"files\", \"129\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause'"]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php","line":938,"function":"driverExceptionDuringQuery","class":"Doctrine\\DBAL\\DBALException","type":"::","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDOMySql\\Driver"},{"errorInfo":["42S22",1054,"Unknown column 'r.id' in 'on clause'"],"__class__":"Doctrine\\DBAL\\Driver\\PDOException"},"SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)",{"1":"admin","2":"files","3":"129"}]},{"file":"\/var\/www\/html\/lib\/private\/DB\/Connection.php","line":195,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)",["admin","files","129"],[2,2,2],null]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":219,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = :dcValue1) WHERE (`r`.`resource_type` = :dcValue2) AND (`r`.`resource_id` = :dcValue3)",{"dcValue1":"admin","dcValue2":"files","dcValue3":"129"},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php","line":214,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php","line":208,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php","line":167,"function":"getResourceForUser","class":"OC\\Collaboration\\Resources\\Manager","type":"->","args":["files","129",{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"getCollectionsByResource","class":"OC\\Core\\Controller\\CollaborationResourcesController","type":"->","args":["files","129"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\CollaborationResourcesController","getCollectionsByResource",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/collaboration\/resources\/files\/129"]},{"file":"\/var\/www\/html\/ocs\/v2.php","line":24,"args":["\/var\/www\/html\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","Line":79,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDOException","Message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause'","Code":"42S22","Trace":[{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php","line":930,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDOStatement","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/DB\/Connection.php","line":195,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)",["admin","files","129"],[2,2,2],null]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":219,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = :dcValue1) WHERE (`r`.`resource_type` = :dcValue2) AND (`r`.`resource_id` = :dcValue3)",{"dcValue1":"admin","dcValue2":"files","dcValue3":"129"},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php","line":214,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php","line":208,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php","line":167,"function":"getResourceForUser","class":"OC\\Collaboration\\Resources\\Manager","type":"->","args":["files","129",{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"getCollectionsByResource","class":"OC\\Core\\Controller\\CollaborationResourcesController","type":"->","args":["files","129"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\CollaborationResourcesController","getCollectionsByResource",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/collaboration\/resources\/files\/129"]},{"file":"\/var\/www\/html\/ocs\/v2.php","line":24,"args":["\/var\/www\/html\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php","Line":143,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'r.id' in 'on clause'","Code":"42S22","Trace":[{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php","line":141,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php","line":930,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDOStatement","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/DB\/Connection.php","line":195,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = ?) WHERE (`r`.`resource_type` = ?) AND (`r`.`resource_id` = ?)",["admin","files","129"],[2,2,2],null]},{"file":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Query\/QueryBuilder.php","line":219,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `r`.*, `a`.`access` FROM `oc_collres_resources` `r` LEFT JOIN `oc_collres_accesscache` `a` ON (`r`.`id` = `a`.`resource_id`) AND (`a`.`user_id` = :dcValue1) WHERE (`r`.`resource_type` = :dcValue2) AND (`r`.`resource_id` = :dcValue3)",{"dcValue1":"admin","dcValue2":"files","dcValue3":"129"},{"dcValue1":2,"dcValue2":2,"dcValue3":2}]},{"file":"\/var\/www\/html\/lib\/private\/DB\/QueryBuilder\/QueryBuilder.php","line":214,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php","line":208,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"\/var\/www\/html\/core\/Controller\/CollaborationResourcesController.php","line":167,"function":"getResourceForUser","class":"OC\\Collaboration\\Resources\\Manager","type":"->","args":["files","129",{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"getCollectionsByResource","class":"OC\\Core\\Controller\\CollaborationResourcesController","type":"->","args":["files","129"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\CollaborationResourcesController"},"getCollectionsByResource"]},{"file":"\/var\/www\/html\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\CollaborationResourcesController","getCollectionsByResource",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"resourceType":"files","resourceId":"129","_route":"ocs.core.CollaborationResources.getCollectionsByResource"}]},{"file":"\/var\/www\/html\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/collaboration\/resources\/files\/129"]},{"file":"\/var\/www\/html\/ocs\/v2.php","line":24,"args":["\/var\/www\/html\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/html\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php","Line":141}},"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/72.0.3626.96 Safari\/537.36","version":"16.0.0.1"}
{"reqId":"TXIT3tlULgV1uBQKEEl7","level":3,"time":"2019-02-14T13:36:59+00:00","remoteAddr":"192.168.21.1","user":"admin","app":"PHP","method":"POST","url":"\/ocs\/v2.php\/collaboration\/resources\/files\/129?format=json","message":"Error: Call to undefined method OCA\\Files\\Collaboration\\Resources\\ResourceProvider::canAccess() at \/var\/www\/html\/lib\/private\/Collaboration\/Resources\/Manager.php#315","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/72.0.3626.96 Safari\/537.36","version":"16.0.0.1"}

@juliusknorr juliusknorr force-pushed the feature/11015/collaboration-resources branch 2 times, most recently from ad79f75 to f98fe49 Compare February 20, 2019 18:19
@juliusknorr
Copy link
Member

juliusknorr commented Feb 20, 2019

@nickvergessen I tried to fix some more issues with the access cache joins. Seems to work now except for two issues, maybe you can have a look at those:

  • When adding a resource to a collection the access cache entries for the collections resources get duplicated
  • Access cache entries for collections are never added to the access cache

@nickvergessen
Copy link
Member Author

nickvergessen commented Feb 21, 2019

Also todo:

  • Add listener to group membership changes and purge for the user in that case.
  • File sharing should purge access cache when a share is added/removed

@nickvergessen
Copy link
Member Author

I think the backend should be ready now

@juliusknorr juliusknorr force-pushed the feature/11015/collaboration-resources branch 2 times, most recently from eae2a61 to a20bd71 Compare February 24, 2019 08:17
juliusknorr and others added 24 commits March 1, 2019 20:56
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
@juliusknorr juliusknorr force-pushed the feature/11015/collaboration-resources branch from f4d7446 to ca0624d Compare March 1, 2019 19:59
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do this!

@rullzer rullzer merged commit 2398d11 into master Mar 1, 2019
@rullzer rullzer deleted the feature/11015/collaboration-resources branch March 1, 2019 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants