Remote File Browser

From ParaQ Wiki
Jump to navigationJump to search

Requirements

  • Grouping of animation files to improve responsiveness of the UI
  • Store / retrieve user favorites
  • Local and remote file browsing
  • Enter paths manually
  • Display a list of parents to the current directory
  • Provide quick access to "special" folders, e.g. "Home", "Desktop", "My Favorites", etc.
  • Multiselect related files, e.g. separate geometry and attribute files
  • Display additional file attributes, e.g. size, create date, modify date, etc

Optional Requirements

  • Provide create directory / delete / rename functionality?
  • File previewing?

File browser design

The ParaQ client defines an abstract interface for file-browsing back-ends, class pqFileDialogModel. The two implementations of pqFileDialogModel are pqLocalFileDialogModel and pqServerFileDialogModel, which implement the required functionality for browsing the local host and a connected PVS server, respectively.

pqFileDialog is the Qt user interface component that is the "front end" for pqFileDialogModel, providing a common graphical user interface for both local and remote file browsing:

File browser.png

  • The left-hand pane provides a server-specific list of "special" folders (e.g. Windows drives, "Home", "Desktop", "My Favorites", etc).
  • The right-hand pane displays the contents of the currently-visible directory.
  • The "Look in" combo-box lists the parent directories of the currently-visible directory, allowing rapid navigation "upwards" in the filesystem.
  • Users may use the "File name" line entry to select files through manual entry. The user may enter absolute or relative paths. Relative paths are interpreted relative to the currently visible directory.
  • Incomplete: related files (e.g. numbered animation files) can be grouped and expanded/collapsed to decrease clutter and make the UI more responsive.
  • Proposed: users could drag-and-drop files and directories from the right-hand pane to the left-hand pane, where they will be retained as "favorites".

Remote File Browser API

The following operations will need to be implemented by the vtkPVServerFileListing API to support the above requirements:

  • GetCurrentWorkingDirectory - unchanged.
  • GetFileGroups - returns a list of directories and a list of "file groups". A file group may contain one-to-many files and is represented by a label and a file count. Note that this means that grouping of related files is performed on the server-side, to reduce network traffic.
  • GetFileGroup - returns the list of files (one-to-many) contained within a given group. Returns filename, file size, and last modification date for each file.
  • GetSpecial - returns a list of "special" directories / files, including Windows drive letters, "home", "desktop", "my documents", and other platform-specific special files. This list could (optionally) include user favorites. Returns an absolute path and label for each directory / file.

The following operations will need to be implemented by the vtkPVServerFileListing API to support optional requirements:

  • AddFavorite - stores a label & absolute path on the server in per-user storage as a user "favorite". The label acts as a unique key.
  • DeleteFavorite - deletes a favorite path from server per-user storage. A label is supplied as a unique key.
  • CreateDirectory - takes an absolute path as input and creates a new directory on the server.
  • Remove - takes an absolute path as input and deletes a directory / file on the server.
  • Move - takes two absolute paths as input and renames the given directory / file on the server.
  • Read - takes an absolute path, a file offset, and a buffer length as input and reads the given range of data from a file (client-side preview)
  • GetPreview - takes an absolute path, width, and height as input, and returns a bitmap image with given dimensions (server-side preview)