File Views
Introduction
The basic idea of the File View feature is to allow a user to define views of files within a given scope. A scope can be defined as one or more file containers (Projects or Folders). For example, if a user wants to create a file view that includes all files in Project A and Project B, they would define the scope to include both projects. Once the scope is defined, the next step will be to choose the columns they wish to include in the new file view. Once a view is created, and the scope and columns are defined, users will be able to query the view exactly the same as any other table in Synapse. See the following Mockups:
Mockups
Bulk File Update
A File View is technically a 'view' of all files within the defined scope. Therefore, any edit operations on a view will not edit the contents of the view directly. Instead, the edit of a view will be treated as a bulk update of the actual Files in the view. After the Files are updated, the view will be recreated, so the changes will appear in the resulting new view.
Authorization
There are two separate authorization considerations with File Views:
- ACL on the FileView itself.
- ACL on each FileEntity shown in the view.
In order for any user to query a FileView they must first be granted the READ permission on the FileView. In addition, a table view query result will only include rows for FileEntities that the caller has been granted the READ permission. This means two different users may not see the same rows in any given FileView.
Since the data in a FileView contains only FileEntity metadata, the same authorization rules that apply to FileEntity metadata will apply to FileView data. This means if the FileEntity metadata can be viewed by PUBLIC (Public granted READ on the FileEntity), then anyone will be able to see that file's metadata in a FileView.
Note: This is less restrictive than Tables which can only be queried by users with the DOWNLOAD permission.
Models
API
Action | Intended User | URI | Method | Request Body | Response Body |
---|---|---|---|---|---|
Get the list of default ColumnModels for all of the attributes of a FileEntity (name, createdOn, createdBy...) | Anyone. | /column/fileview/default | GET | List<ColumnModel> | |
Get the list of ColumnModels for all annotations found on FileEntities within the given scope. | Anyone | /column/fileview/scope | PUT | ViewScope | List<ColumnModel> |
Create a new FileView. | Anyone | /entity | POST | FileView | FileView |
Start an asynchronous job to query a FileView | Users with READ on the FileView | /entity/{id}/table/query/async/start | POST | QueryBundleRequest | AsyncJobId |
Get the asynchronous job results for a FileView query. | Only the user that started the query job. | /entity/{id}/table/query/async/get/{asyncToken} | GET | QueryResultBundle | |
Start an asynchronous job to download the query results as CSV | User with READ on the FileView | /entity/{id}/table/download/csv/async/start | POST | DownloadFromTableRequest | AsyncJobId |
Get the asynchronous job results for request to download query results as CSV | Only the user that started the download job | /entity/{id}/table/download/csv/async/get/{asyncToken} | GET | DownloadFromTableResult | |
Start an asynchronous job to bulk update FileEntitites using a CSV. | User with UPDATE on each FileEntity to be updated. | /entity/{id}/table/upload/csv/async/start | POST | UploadToTableRequest | AsyncJobId |
Get the asynchronous job results for bulk update FileEntitites using a CSV. | Only the user that started the upload job | /entity/{id}/table/upload/csv/async/get/{asyncToken} | GET | UploadToTableResult |