Skip to main content

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

ItemValue
Route stateapp.network.wizard.drive
URL/wizard/drive
Feature flagFEATURE_ARCHIVE_NEW
ControllerDriveWizardController
JS fileSC/suredms-web-client/src/main/webapp/app/js/network/study/drive/drive-wizard.js
TemplateSC/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:

FieldModel bindingNotes
NamedriveWizard.context.nameRequired
DescriptiondriveWizard.context.descriptionOptional
Planned SitesdriveWizard.context.targetSitesNumber input
Drive Start DatedriveWizard.context.startDateDate picker
Drive Duration (months)driveWizard.context.durationNumber input
Drive End Date(display only)Calculated from start + duration
Duplicate Name PolicydriveWizard.context.namePolicyDropdown: 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:

  1. DriveWizardController calls ArchiveCreatorService.createSureDrive(parameters)
  2. This sets archiveType = ENTITY_CLOUD_ARCHIVE and calls ArchiveCreatorService.createArchive(parameters)
  3. createArchive posts to Nuxeo via ConnectionService using the operation constant OPERATION_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):

  1. createDataPropertyDefinitions
  2. createAnnotationDefinitions
  3. createOrganizationRoles
  4. createPersonRoles
  5. createOrganizations
  6. createPersons
  7. createDocDiscrepancyTypes
  8. createCategories (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:

StepMethodWhat it does
1createDataPropertyDefinitionsCreates all metadata property definitions in parallel chunks of up to 6 (MAX_PARALLEL_CONNECTIONS = 6)
2createAnnotationDefinitionsCreates annotation type definitions for the archive
3createOrganizationRolesCreates organization role types
4createPersonRolesCreates person role types
5createOrganizationsCreates initial organization records
6createPersonsCreates initial person records
7createDocDiscrepancyTypesCreates document discrepancy type definitions
8createCategoriesCreates category, content type, and cloud folder hierarchy (counts categories, contentTypes, cloudFolders)
9createFoldersCreates 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:

ConditionOperationParameters
cloneDocumentNaming || cloneDocumentMilestonesOPERATION_ARCHIVE_CLONE_SETTINGSsourceArchiveId, cloneDocumentNaming, cloneMilestones, cloneMetrics
cloneMetricsOPERATION_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

ConstantArchive type
ENTITY_CLOUD_ARCHIVESureDrive
ENTITY_ARCHIVEStudy
ENTITY_QUALITY_ARCHIVESureQMS
ENTITY_IMAGING_ARCHIVEMedical imaging archive

Source: SC/suredms-web-client/src/main/webapp/app/js/network/study/drive/archive-creator.js