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.javaSC/suredms-common/src/main/java/com/sureclinical/suredms/entity/ArchiveEntity.javaSC/suredms-common/src/main/java/com/sureclinical/suredms/entity/CommonEntityProvider.javaSC/suredms-common/src/main/java/com/sureclinical/suredms/services/AbstractService.javaSC/suredms-common/src/main/java/com/sureclinical/suredms/services/AbstractSharedService.javaSC/suredms-common/src/main/java/com/sureclinical/suredms/services/preferences/GlobalPreferenceManager.java
Primary Components
AbstractEntitydefines the common persistence contract: id, path, creator, timestamps, trash state, and type.ArchiveEntityextends the base contract with archive-specific behavior such as content model metadata, numbering scheme, archive subtype checks, and duplication policy.CloudArchiveEntitymarks the SureDrive-specific archive type and carries theSureDrivenaming constants.ContentTypeEntityrepresents hierarchical content types and exposes helper methods that classify ISF/QMS-controlled content.PersonEntityandOrganizationEntitymodel archive members, including role links, contact details, and active/inactive state.DocumentEntityis the shared document contract. It exposes content, signature, lifecycle, controlled/training flags, and links back to the owning archive, content type, person, and organization.DataPropertyDefinitionEntitymodels configurable metadata definitions and validation requirements.AbstractServiceandAbstractSharedServicedefine the shared service base classes.AbstractSharedServicemarks services that are shared across instances.GlobalPreferenceManagercentralizes 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
commonandutil. - Shared service types should not be confused with module-specific implementations. The page documents the contract layer, not the concrete persistence classes.