-
Notifications
You must be signed in to change notification settings - Fork 52
Description
CBRAIN original, core, model for the files has always been that a DataProvider is like a standard filesystem folder, and that it can only hold one file with a particular name.
This restriction is still enforced on all DataProviders that are physically implemented as a single folder level (e.g. the Vault types, the FlatDir types, etc).
An deviation of that model was introduced for DPs that store each userfile in distinct filesystem location. For instance the EnCbrain types store each userfile in an filesystem subtree like 00/00/00/basename allowing multiple files named basename on the DP. These DPs are typically multi-user DPs, so we didn't want to prevent a user from having a file named 'abc.txt' if another user already had a file called 'abc.txt'. That being said, any single user cannot have two files with the same name on it.
The CBRAIN file management methods know which DP has which of these two capabilities by querying, as needed, the method content_storage_shared_between_users? :
- if it returns
truethen the DP is like a single folder - if it returns false then the DP stores each userfile in separate location
What I'd like to introduce is an even more versatile version of the DP that store files in separate location. Instead of preventing a user from having two files with the same name, we would allow this provided the PROJECT name is distinct. This would turn the concept of a project in CBRAIN into something much more akin to an actual distinct folder.
What is required to get there is very complicated and tricky, however:
- All callbacks for userfile validations need to be updated to verify the special cases of these special new DPs.
- All file operations (copy, move, register, delete, update) need to be updated to make new checks about the capabilities of the DPs
- User need to be notified and informed about this, and warned about potential problems, because a typically a user has access to a whole set of data providers types, including the standard FlatDir types, and if they are not careful they could not realize that by moving/copying/creating a file in a project they could be affecting the content of another file instead.