Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Apr 4, 2023
1 parent d99d70f commit 6e2f3e0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
51 changes: 51 additions & 0 deletions modules/electrophysiology_uploader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Electrophysiology Uploader

## Purpose

The electrophysiology uploader is intended to allow users to upload and browse electrophysiology files.


## Intended Users

The primary users are EEG technicians or site coordinators uploading EEG recordings
for registered LORIS candidates and timepoints.

## Scope

The electrophysiology uploader has the following built-in capabilities to facilitate
timely eeg insertion into the LORIS database. Specifically, it allows to browse
uploaded recordings using the `Browse` tab and upload recordings using the `Upload`
tab.

EEG recordings can be reuploaded multiple times. Previous upload attempts will be backup in _EEGUploadIncomingPath_/archives/.

## Permissions

#### Module Permission

Permission `electrophysiology_browser_view_allsites` or `electrophysiology_browser_view_site`
is necessary to have access to the module and gives the user the ability to
upload and browse all recordings uploaded to the database.

#### Filesystem Permission

The path on the filesystem where the uploaded files go (_EEGUploadIncomingPath_) should be
readable and writable by the web server.

## Configurations

The electrophysiology uploader has the following configurations that affect its usage:

### Install Configurations

To enable the module to handle large files, please follow the
instructons for [Handling Large File Uploads](../../docs/wiki/00_SERVER_INSTALL_AND_CONFIGURATION/02_Website_Configuration/Handling_Large_File_Uploads.md).

#### <a name="database_config_link"></a> Database Configurations

EEGUploadIncomingPath - This setting determines where on the filesystem the
uploader is to place the uploaded recordings.
**Note**: Uploaded recordings are erased from the
`EEGUploadIncomingPath` following a successful archival and insertion
through the LORIS-MRI pipeline.

14 changes: 6 additions & 8 deletions modules/electrophysiology_uploader/jsx/UploadViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ export default function UploadViewer(props) {
];

return (
<>
<FilterableDataTable
name='eeg_upload_viewer'
data={props.data}
fields={fields}
getFormattedCell={formatColumn}
/>
</>
<FilterableDataTable
name='eeg_upload_viewer'
data={props.data}
fields={fields}
getFormattedCell={formatColumn}
/>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Electrophysiology_Uploader extends \DataFrameworkMenu
*/
public function useProjectFilter(): bool
{
return false;
return true;
}

/**
Expand Down
9 changes: 6 additions & 3 deletions modules/electrophysiology_uploader/php/upload.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Upload extends \NDB_Page
if (empty($request->getUploadedFiles()) && empty($values)) {
$upload_max_size = \Utility::getMaxUploadSize();
return new \LORIS\Http\Response\JSON\InternalServerError(
"The uploaded file size ($upload_max_size) exceeds " .
"the upload_max_filesize or post_max_size directive in php.ini"
"The uploaded file size exceeds the upload_max_filesize " .
"or post_max_size directive in php.ini ($upload_max_size)"
);
}

Expand Down Expand Up @@ -176,7 +176,10 @@ class Upload extends \NDB_Page
);
}

// Check for existing files
// Check for an existing file
// If found, add a timestamp suffix to avoid collision
// with any other existing upload attempt
// and move the renamed file in _EEGUploadIncomingPath_/archives/
$targetPath = $targetdir->getPathname() . '/' . $filename;
if (file_exists($targetPath)) {
$archiveFilename = str_replace(
Expand Down

0 comments on commit 6e2f3e0

Please # to comment.