Drive Wizard and New SureDrive Creation
The New SureDrive Wizard is the primary creation flow for SureDrive archives in the web client. It is a multi-step Angular wizard that collects project metadata, applies an optional template, validates the input, and calls the Nuxeo Automation Operation Mobile.CreateStudy to create the archive.
Entry Point
| Item | Value |
|---|---|
| Route state | app.network.wizard.drive |
| URL | /wizard/drive |
| Feature flag | FEATURE_ARCHIVE_NEW |
| Controller | DriveWizardController |
| JS file | SC/suredms-web-client/src/main/webapp/app/js/network/study/drive/drive-wizard.js |
| Template | SC/suredms-web-client/src/main/webapp/app/views/network/study/wizard/drive-wizard.html |
The wizard is launched from the + button on the Application Dashboard.
Wizard Steps
Step 1 — Drive Details
Collects the core project metadata:
| Field | Model binding | Notes |
|---|---|---|
| Name | driveWizard.context.name | Required |
| Description | driveWizard.context.description | Optional |
| Planned Sites | driveWizard.context.targetSites | Number input |
| Drive Start Date | driveWizard.context.startDate | Date picker |
| Drive Duration (months) | driveWizard.context.duration | Number input |
| Drive End Date | (display only) | Calculated from start + duration |
| Duplicate Name Policy | driveWizard.context.namePolicy | Dropdown: Allow Duplicates / Unique Case-Insensitive / Unique Case-Sensitive |
Step 2 — Template Selection
Controls whether the new drive is created from:
- Empty SureDrive — no template
- Existing study template — chosen from
driveWizard.templates.studies(existing drives available to the user as templates) - Custom template — chosen from
driveWizard.templates.custom(uploaded Excel files or folder structures) - Drag-and-drop Excel — upload a spreadsheet to import folder structure, persons, organisations, and roles
If a template is selected, the wizard shows a third Content step that previews what will be copied from the template (categories, properties, annotations, organisations, persons, and roles).
Step 3 — Confirmation
A summary dialog is shown before the create call is triggered.
Validation
Before submission, ArchiveModelValidator.validateArchive is called on the wizard context. If validation fails (e.g., missing required metadata fields), ArchiveModelFillerService.showWizard(archiveModel) is opened to let the user fix the gaps.
Creation Flow
JavaScript (front-end)
The creation is handled by SC/suredms-web-client/src/main/webapp/app/js/network/study/wizard/archive-creator.js:
DriveWizardControllercallsArchiveCreatorService.createSureDrive(parameters)- This sets
archiveType = ENTITY_CLOUD_ARCHIVEand callsArchiveCreatorService.createArchive(parameters) createArchiveposts to Nuxeo viaConnectionServiceusing the operation constantOPERATION_MOBILE_CREATE_STUDY→ Nuxeo Automation Operation:Mobile.CreateStudy
Post-Creation Pipeline
After the archive document is created in Nuxeo, the front end runs an async chain to populate it with data from the chosen template (or empty defaults):
createDataPropertyDefinitionscreateAnnotationDefinitionscreateOrganizationRolescreatePersonRolescreateOrganizationscreatePersonscreateDocDiscrepancyTypescreateCategories(folders and content types)
Template Import
If a template drive was selected: ArchiveTemplateService.importSelectedTemplate(parameters) handles copying the structure.
If a file/folder drag-and-drop was used: ImportArchiveService.importArchive(params) handles parsing and import.
Excel-based templates are parsed by suredms-xls-parser. See Excel and Template Importers.
Nuxeo Document Type
The created archive is a Nuxeo document of type SureDMS.CloudArchive, defined in SC/suredms-nuxeo-extensions/suredms-nuxeo-doctypes/src/main/resources/OSGI-INF/suredms-types-contrib.xml.
Type hierarchy:
SureDMS.CloudArchive
extends SureDMS.Archive
extends SimpleFolder (Nuxeo Folderish)
The archive uses the suredms.archive Nuxeo schema for lifecycle and configuration metadata (duration, name policy, status flags, etc.).
The Mobile.CreateStudy operation initialises the workspace in the Nuxeo repository and sets up the security/ACL configuration for the new archive.
Post-Creation Call Sequence
After the Mobile.CreateStudy Nuxeo operation succeeds, ArchiveCreatorService.createArchive executes a sequential post-creation chain to populate the new drive with its initial content model data. The service method entry point is ArchiveCreatorService.createSureDrive(parameters), which delegates to createArchive(parameters) via ConnectionService.postRequest(OPERATION_MOBILE_CREATE_STUDY).
When the buildInChain flag is set (true for template-based creation), the following steps run sequentially:
| Step | Method | What it does |
|---|---|---|
| 1 | createDataPropertyDefinitions | Creates all metadata property definitions in parallel chunks of up to 6 (MAX_PARALLEL_CONNECTIONS = 6) |
| 2 | createAnnotationDefinitions | Creates annotation type definitions for the archive |
| 3 | createOrganizationRoles | Creates organization role types |
| 4 | createPersonRoles | Creates person role types |
| 5 | createOrganizations | Creates initial organization records |
| 6 | createPersons | Creates initial person records |
| 7 | createDocDiscrepancyTypes | Creates document discrepancy type definitions |
| 8 | createCategories | Creates category, content type, and cloud folder hierarchy (counts categories, contentTypes, cloudFolders) |
| 9 | createFolders | Creates the nested folder structure from the content model |
Parallel entity creation uses createInChunks — items are sent in batches of 6 concurrent requests to limit server load.
Clone Settings (Study-Based Creation)
If studyBased is true and the wizard includes clone flags, two additional operations run after the main chain:
| Condition | Operation | Parameters |
|---|---|---|
cloneDocumentNaming || cloneDocumentMilestones | OPERATION_ARCHIVE_CLONE_SETTINGS | sourceArchiveId, cloneDocumentNaming, cloneMilestones, cloneMetrics |
cloneMetrics | OPERATION_MOBILE_CLONE_WORKFLOW_METRICS | (workflow metric definitions from source archive) |
Duplicate Name Policy
Duplicate archive name validation is server-side only — the Angular client does not check for name collisions. The Mobile.CreateStudy Nuxeo operation returns an error if the name already exists in the workspace.
Archive Type Constants
| Constant | Archive type |
|---|---|
ENTITY_CLOUD_ARCHIVE | SureDrive |
ENTITY_ARCHIVE | Study |
ENTITY_QUALITY_ARCHIVE | SureQMS |
ENTITY_IMAGING_ARCHIVE | Medical imaging archive |
Source: SC/suredms-web-client/src/main/webapp/app/js/network/study/drive/archive-creator.js