Skip to main content

Document Management

This page documents the document browser, upload, download, history, attachment, visibility, and PDF tool subsystems in SureDrive. It covers the Angular routes and controllers, the upload service, backend operation constants, and the document entity model.


Overview

Documents in SureDrive are stored within a folder hierarchy defined by the Content Model Editor. The document navigator is the primary user interface — it renders the folder tree on the left and a document list or preview panel on the right. All document operations (upload, download, move, share, sign, annotate, delete, restore) are initiated from this view.

Key owning modules:

  • UI: suredms-web-clientnetwork/study/ folder tree, upload wizard, document detail views
  • Service layer: suredms-web-service — document streaming and processing endpoints
  • Domain model: suredms-commonDocumentEntity, BlobDescriptor

Angular Routes

File: SC/suredms-web-client/src/main/webapp/app/js/state/app-states.js

StateTemplate / ControllerPurpose
app.network.study.browse.filesdrive-file-navigator.htmlMain SureDrive document navigator; folder tree + document list
app.network.study.browse.documentStudyDocumentControllerDocument detail view; metadata, preview, workflow actions
app.network.study.upload-driveDriveUploadFilesControllerMulti-file upload wizard for SureDrive
app.network.study.browse.attachmentStudyAttachmentControllerAttachment detail view for a specific document attachment

Controllers and Services

DriveUploadFilesController

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/drive-upload-files.js

Orchestrates the multi-file upload process. Responsibilities:

  • Collects files from the browser drag/drop or file picker.
  • Allows users to assign content type (folder placement), metadata fields, and PDF conversion options per file.
  • Supports manualVersionChange (Major/Minor version increment selection during upload).
  • Emits upload progress events consumed by the progress indicator component.

StudyDocumentController

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-document-details.js

Manages the document detail panel. Responsibilities:

  • Renders document metadata and the PDF preview iframe.
  • Surfaces actions: review, sign, initiate workflow process, associate with tasks.
  • Delegates permission checks to DocumentPermissionsHelper (see Role-Based Access Control).

StudyDocumentHistoryController

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-document-history.js

Handles the version history panel for a document:

MethodOperation
fetchDocumentHistoryCalls Mobile.GetDocumentHistory to populate the versions list
revertDocumentCalls OPERATION_DOCUMENT_RESTORE_VERSION to promote an older version to current

UploadFilesHelperService

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/study-upload.js

Shared utility service for all document upload flows:

MethodPurpose
reloadRequiredMetadataFetches mandatory metadata fields based on content type and user role
populateUploadTaskParamsConfigures upload parameters when the upload is part of a workflow task
handleEmailParses .msg / .eml files using JSZip; extracts attachments as individual document objects
copyMetadataParametersSynchronises metadata across multiple files in a batch upload

ContentVisibilityService

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-content-visibility-service.js

Manages ACL rules for documents and folders. Implements the backend of the Configuring Document Visibility and Configuring Content Visibility Help flows. Works with ExpandedArchiveAclRule (see Role-Based Access Control).

TrashedArchiveService

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/study-trash.js

Handles soft-delete and permanent-delete flows:

MethodBackend Operation
undeleteArchiveMobile.UndeleteDocuments — restores deleted documents
purgeArchiveMobile.PurgeDocuments — permanently removes documents

StudyNavigatorFileEditorService

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/study-navigator-file-editor.js

Facilitates in-browser PDF manipulation: Split, Merge, and Redact operations surfaced via the PDF Tools panel in the document detail view.


Document Entity Model

File: SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/DocumentEntity.java

MethodDescription
getVersion()Internal numeric version counter
getManualVersionString()User-facing version string (e.g., 1.0, 2.1)
getContentSize()File size in bytes
getDocumentStatus()Lifecycle state: Draft, Effective, Obsolete
isDocumentLocked()true if the document is checked out or otherwise restricted

Backend Operation Constants

Operations are defined in constants-operations.js and executed via ConnectionService. Key document operations:

ConstantOperation StringPurpose
OPERATION_MOBILE_UPLOAD_DOCUMENTMobile.UploadDocumentStreams document binary to the server
Mobile.GetDocumentHistoryReturns version list for a document
OPERATION_DOCUMENT_RESTORE_VERSIONPromotes an older version to current
Mobile.UndeleteDocumentsRestores documents from trash
Mobile.PurgeDocumentsPermanently deletes documents

Document Operations Reference

Help TopicOperationEntry Point
Uploading DocumentsDriveUploadFilesControllerMobile.UploadDocumentDocuments area → Upload button
Downloading DocumentsStudyDocumentController → download actionDocument detail → Download
Moving Documents to ArchiveDocumentPermissionsHelper.canBeMovedToArchive() + acquire queue serviceDocument detail → Move to Archive
Deleting DocumentsSoft delete to trashDocument context menu → Delete
Restoring DocumentsTrashedArchiveService.undeleteArchiveTrash → Restore
Permanently DeletingTrashedArchiveService.purgeArchiveTrash → Permanently Delete
Document HistoryStudyDocumentHistoryController.fetchDocumentHistoryDocument detail → History tab
Revert VersionStudyDocumentHistoryController.revertDocumentHistory tab → Revert
Moving / CopyingStudyNavigatorFileEditorServiceDocument context menu → Move / Copy
Configuring VisibilityContentVisibilityServiceDocument detail → Visibility
Content Visibility (folder)ContentVisibilityServiceFolder context menu → Content Visibility
Using PDF ToolsStudyNavigatorFileEditorService → split / merge / redactDocument detail → PDF Tools
Sharing DocumentsACTION_SHARE_BOOKMARK / sharing serviceDocument detail → Share
Managing AttachmentsStudyAttachmentControllerDocument detail → Attachments tab
Submitting DiscrepanciesQuality review flowDocument detail → Submit Discrepancy
Working with Expired DocumentsExpiry filter in navigatorDocuments → filter by Expired
Importing from SharePointConnector integration (see Connectors)Documents → Import from SharePoint

Bookmarks

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/bookmarks/study-bookmark-navigator.js

StudyBookmarkNavigatorController manages the dedicated Bookmarks view — a filtered version of the document tree showing only user-marked favourites. The ACTION_SHARE_BOOKMARK action allows users to create a direct link to a bookmarked folder or document and share it with other team members.


Keyboard Navigation

File: SC/suredms-web-client/src/main/webapp/app/js/network/study/study-navigator.js

StudyAbstractNavigatorController injects KeyboardNavigationService to handle keyboard shortcuts across the Documents, Bookmarks, Acquire Queue, and Quality Queue views.

KeyMethod / Action
/ arrowselectPreviousEntity / selectNextEntity — move selection in the tree
EnterOpen selected item
BackspaceNavigate to parent directory
EscapeClear selection
DeleteTrigger delete action on selected item (where applicable)

KeyboardNavigationService.bindKeyListener is used in individual controllers to map additional keys to context-specific document actions.


Key Source Files Reference

FilePurpose
SC/suredms-web-client/src/main/webapp/app/js/state/app-states.jsRoute definitions for document navigator, detail, upload, attachment states
SC/suredms-web-client/src/main/webapp/app/js/network/study/drive-upload-files.jsMulti-file upload wizard controller
SC/suredms-web-client/src/main/webapp/app/js/network/study/study-upload.jsUploadFilesHelperService — shared upload utility
SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-document-details.jsDocument detail controller
SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-document-history.jsDocument version history controller
SC/suredms-web-client/src/main/webapp/app/js/network/study/documents/study-content-visibility-service.jsDocument and folder ACL / visibility service
SC/suredms-web-client/src/main/webapp/app/js/network/study/study-trash.jsRestore and permanent-delete service
SC/suredms-web-client/src/main/webapp/app/js/network/study/study-navigator-file-editor.jsPDF tools: Split, Merge, Redact
SC/suredms-web-client/src/main/webapp/app/js/network/study/study-navigator.jsDocument tree navigator; keyboard navigation integration
SC/suredms-web-client/src/main/webapp/app/js/network/study/bookmarks/study-bookmark-navigator.jsBookmarks view controller
SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/DocumentEntity.javaDocument domain entity interface