Skip to main content

Shared Domain and Utilities

This page covers the shared domain layer that most SureDrive features depend on. The core types live in SC/suredms-common/src/main/java/com/sureclinical/suredms/entity and SC/suredms-common/src/main/java/com/sureclinical/suredms/services, with helper logic spread across util, common, and service subpackages.

Purpose

The shared layer provides the object model and service contracts used by web, workflow, parser, desktop, and service modules. It defines what an archive, content type, folder, person, organization, document, and preference mean in this codebase.

Scope

This page is limited to reusable domain types and support services. It does not cover UI routes, parser implementations, or OCR/document-intelligence processing.

Entry Points

  • SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/AbstractEntity.java
  • SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/ArchiveEntity.java
  • SC/suredms-common/src/main/java/com/sureclinical/suredms/entity/CommonEntityProvider.java
  • SC/suredms-common/src/main/java/com/sureclinical/suredms/services/AbstractService.java
  • SC/suredms-common/src/main/java/com/sureclinical/suredms/services/AbstractSharedService.java
  • SC/suredms-common/src/main/java/com/sureclinical/suredms/services/preferences/GlobalPreferenceManager.java

Primary Components

  • AbstractEntity defines the common persistence contract: id, path, creator, timestamps, trash state, and type.
  • ArchiveEntity extends the base contract with archive-specific behavior such as content model metadata, numbering scheme, archive subtype checks, and duplication policy.
  • CloudArchiveEntity marks the SureDrive-specific archive type and carries the SureDrive naming constants.
  • ContentTypeEntity represents hierarchical content types and exposes helper methods that classify ISF/QMS-controlled content.
  • PersonEntity and OrganizationEntity model archive members, including role links, contact details, and active/inactive state.
  • DocumentEntity is the shared document contract. It exposes content, signature, lifecycle, controlled/training flags, and links back to the owning archive, content type, person, and organization.
  • DataPropertyDefinitionEntity models configurable metadata definitions and validation requirements.
  • AbstractService and AbstractSharedService define the shared service base classes. AbstractSharedService marks services that are shared across instances.
  • GlobalPreferenceManager centralizes preference keys for email, visibility, workflow, reporting, and archive/document behavior.

Data Flow

Shared domain types are usually loaded through a service implementation and then passed into higher-level features. For example, parser code builds ArchiveModel objects using the same conceptual entities that the runtime services expose, while GlobalPreferenceManager feeds runtime behavior in utilities such as locale helpers, PDF handling, workflow rules, and email settings.

Key Behaviors

  • Shared entities are used as contracts rather than concrete UI models.
  • Preference access is centralized through named keys so callers do not hard-code configuration strings everywhere.
  • Helper methods on the entity interfaces provide classification logic for specific product areas, such as controlled documents, training documents, or shared ISF content.

Dependencies and Integrations

  • Parser modules consume the shared entity contracts when they convert workbook or XML input into archive models.
  • Web and workflow modules use the same shared preference keys to enforce comments, sharing behavior, and edit permissions.
  • OCR and image utilities use shared helper classes for file and locale handling.

Edge Cases and Constraints

  • Some interfaces expose default helper methods that depend on utility classes in common and util.
  • Shared service types should not be confused with module-specific implementations. The page documents the contract layer, not the concrete persistence classes.