Skip to content

Conversation

Copy link

Copilot AI commented Nov 26, 2025

Comprehensive investigation and working prototype for migrating Alfresco content models to Nuxeo, including automated mapping of types, aspects, properties, associations, and constraints with documented limitations.

Investigation Document

docs/investigation/ALFRESCO_NUXEO_DATA_MODEL_MAPPING.md (28KB)

  • Entity mapping tables: Types→Document Types, Aspects→Facets+Schemas, Properties→Fields, Associations→Relations
  • Data type conversion matrix: 15+ Alfresco types (d:text, d:mltext, d:noderef, etc.) → Nuxeo equivalents
  • 10 documented unresolved issues with severity ratings (dynamic aspect application, mltext loss, noderef type safety)
  • Migration strategy recommendations

Prototype Implementation

Model Representations (org.alfresco.repo.nuxeo.model)

  • NuxeoDocumentType, NuxeoSchema, NuxeoFacet, NuxeoField - Target Nuxeo entities

Mappers (org.alfresco.repo.nuxeo.mapper)

  • AlfrescoToNuxeoTypeMapper - Preserves type hierarchy, maps mandatory aspects to facets
  • AlfrescoToNuxeoAspectMapper - Aspects → Facet+Schema pairs (addresses dynamic application limitation)
  • AlfrescoToNuxeoPropertyMapper - Property conversion with data loss warnings (mltext, noderef, qname)
  • AlfrescoToNuxeoAssociationMapper - Child associations → containment, peer → relations

Core Infrastructure

  • DataTypeConverter - Type mappings with data loss detection
  • NuxeoDataModelMapper - Main orchestrator, generates JSON output
  • MappingContext - Configuration and warning aggregation

Usage Example

// Parse Alfresco model
M2Model alfrescoModel = M2Model.createModel(new FileInputStream("model.xml"));

// Map to Nuxeo
NuxeoDataModelMapper mapper = new NuxeoDataModelMapper();
MappingContext context = mapper.mapModel(alfrescoModel);

// Generate output
String json = mapper.toJSON(context);
String report = mapper.generateSummaryReport(context);

// Check warnings
context.getWarnings().forEach(System.out::println);
// "Property 'cm:title' type 'd:mltext': Multi-lingual text loses language-specific variants"
// "Aspect 'cm:versionable': Nuxeo facets are less dynamic than Alfresco aspects"

Test Coverage

58 test cases across 5 test classes covering type hierarchy mapping, data type conversion, aspect transformation, and end-to-end integration scenarios.

Real-World Example

Complete invoice management model (examples/) demonstrating:

  • 2 types with 10+ properties
  • 2 aspects with constraints
  • Peer associations
  • LIST constraints → validation rules
  • Generated Nuxeo JSON with mapping report

Known Limitations

  • Constraint extraction requires full M2Constraint parsing (documented as TODO)
  • JSON generation uses string concatenation (production should use Jackson/Gson)
  • d:int → long widening (Nuxeo standard, prevents overflow)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • artifacts.alfresco.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/alfresco-community-repo/alfresco-community-repo/data-model org.codehaus.plexus.classworlds.launcher.Launcher clean test -DskipTests -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem Statement

Create a comprehensive investigation comparing Alfresco Data Model with Nuxeo Data Model, including:

  1. Analysis Documentation: A detailed Confluence-style markdown document analyzing both data models
  2. Mapping Tables: Entity relationships and field mappings between Alfresco and Nuxeo
  3. Prototype Implementation: Java code that performs mapping between Alfresco and Nuxeo data model entities
  4. Test Cases: Unit tests demonstrating the mapping functionality

Acceptance Criteria

✅ Analysis of Alfresco Data Model and Nuxeo Data Model is completed

✅ Key differences, required mapping and unresolved issues are identified

✅ Findings are documented in a Confluence-style page (markdown format)

✅ Confluence page includes tables describing entity relationships and field mapping

✅ A prototype code exists that performs mapping between Alfresco Data model and corresponding Nuxeo data model entities

✅ Mapping logic is documented in the confluence page

Reference Documentation

Alfresco Data Model

  • Location: data-model/ folder in alfresco-community-repo
  • Key classes: M2Model, M2Type, M2Aspect, M2Property, M2Class, M2ClassAssociation
  • Data model components: Types, Aspects, Properties, Associations, Namespaces, Constraints

Nuxeo Data Model

Deliverables

1. Investigation Document

Create docs/investigation/ALFRESCO_NUXEO_DATA_MODEL_MAPPING.md with:

  • Executive summary
  • Alfresco data model overview
  • Nuxeo data model overview
  • Detailed comparison tables
  • Key differences and challenges
  • Unresolved issues
  • Recommendations

2. Mapping Tables

Include comprehensive tables for:

  • Entity Mapping: Alfresco Types/Aspects → Nuxeo Document Types/Schemas/Facets
  • Property Mapping: Alfresco Properties → Nuxeo Fields (with data type conversion)
  • Association Mapping: Alfresco Associations → Nuxeo Relations
  • Namespace Mapping: Alfresco Namespaces → Nuxeo Schema prefixes
  • Constraint Mapping: Alfresco Constraints → Nuxeo Validation

3. Prototype Implementation

Create prototype Java code in data-model/src/main/java/org/alfresco/repo/datamodel/nuxeo/:

Core Mapper Classes:

  • NuxeoDataModelMapper.java - Main mapper orchestrating transformations
  • AlfrescoToNuxeoTypeMapper.java - Maps Alfresco Types to Nuxeo Document Types
  • AlfrescoToNuxeoAspectMapper.java - Maps Alfresco Aspects to Nuxeo Schemas/Facets
  • AlfrescoToNuxeoPropertyMapper.java - Maps Alfresco Properties to Nuxeo Fields
  • AlfrescoToNuxeoAssociationMapper.java - Maps Alfresco Associations to Nuxeo Relations
  • DataTypeConverter.java - Converts between Alfresco and Nuxeo data types

Model Classes:

  • NuxeoDocumentType.java - Represents Nuxeo document type
  • NuxeoSchema.java - Represents Nuxeo schema
  • NuxeoFacet.java - Represents Nuxeo facet
  • NuxeoField.java - Represents Nuxeo field
  • MappingContext.java - Context holder for mapping configuration

Configuration:

  • mapping-config.properties - Configuration for custom mappings and rules

4. Test Cases

Create comprehensive tests in data-model/src/test/java/org/alfresco/repo/datamodel/nuxeo/:

  • NuxeoDataModelMapperTest.java - Integration tests
  • AlfrescoToNuxeoTypeMapperTest.java - Type mapping tests
  • AlfrescoToNuxeoAspectMapperTest.java - Aspect mapping tests
  • AlfrescoToNuxeoPropertyMapperTest.java - Property mapping tests
  • DataTypeConverterTest.java - Data type conversion tests

5. Example Mappings

Create example XML/JSON files showing real mapping scenarios:

  • examples/alfresco-content-model.xml - Sample Alfresco model
  • examples/nuxeo-document-type.json - Corresponding Nuxeo output
  • examples/mapping-report.md - Detailed mapping report

Implementation Guidelines

Alfresco Data Model Key Points:

  1. M2Model structure with namespaces, types, aspects, properties
  2. Types have single inheritance, properties, and associations
  3. Aspects provide reusable cross-cutting behaviors
  4. Properties support constraints, indexing, mandatory/multi-valued flags
  5. Associations include child (parent-child) and peer (non-hierarchical)
  6. Namespaces provide model isolation with URI and prefix

Nuxeo Data Model Key Points (from documentation):

  1. Document Types are hierarchical with single inheritance
  2. Schemas group related fields (similar to aspects conceptually)
  3. Facets provide reusable behaviors (mixins)
  4. Fields are typed properties within schemas
  5. Core Types: Document, File, Folder, etc.
  6. Relations for document associations

Mapping Strategy:

  • Alfresco Type → Nuxeo Document Type (with parent hierarchy preserved)
  • Alfresco Aspect → Nuxeo Facet + Schema (aspects become facets with associated schemas)
  • Alfresco Property → Nuxeo Field (with data type conversion)
  • Alfresco Child A...

This pull request was created as a result of the following prompt from Copilot chat.

Problem Statement

Create a comprehensive investigation comparing Alfresco Data Model with Nuxeo Data Model, including:

  1. Analysis Documentation: A detailed Confluence-style markdown document analyzing both data models
  2. Mapping Tables: Entity relationships and field mappings between Alfresco and Nuxeo
  3. Prototype Implementation: Java code that performs mapping between Alfresco and Nuxeo data model entities
  4. Test Cases: Unit tests demonstrating the mapping functionality

Acceptance Criteria

✅ Analysis of Alfresco Data Model and Nuxeo Data Model is completed

✅ Key differences, required mapping and unresolved issues are identified

✅ Findings are documented in a Confluence-style page (markdown format)

✅ Confluence page includes tables describing entity relationships and field mapping

✅ A prototype code exists that performs mapping between Alfresco Data model and corresponding Nuxeo data model entities

✅ Mapping logic is documented in the confluence page

Reference Documentation

Alfresco Data Model

  • Location: data-model/ folder in alfresco-community-repo
  • Key classes: M2Model, M2Type, M2Aspect, M2Property, M2Class, M2ClassAssociation
  • Data model components: Types, Aspects, Properties, Associations, Namespaces, Constraints

Nuxeo Data Model

Deliverables

1. Investigation Document

Create docs/investigation/ALFRESCO_NUXEO_DATA_MODEL_MAPPING.md with:

  • Executive summary
  • Alfresco data model overview
  • Nuxeo data model overview
  • Detailed comparison tables
  • Key differences and challenges
  • Unresolved issues
  • Recommendations

2. Mapping Tables

Include comprehensive tables for:

  • Entity Mapping: Alfresco Types/Aspects → Nuxeo Document Types/Schemas/Facets
  • Property Mapping: Alfresco Properties → Nuxeo Fields (with data type conversion)
  • Association Mapping: Alfresco Associations → Nuxeo Relations
  • Namespace Mapping: Alfresco Namespaces → Nuxeo Schema prefixes
  • Constraint Mapping: Alfresco Constraints → Nuxeo Validation

3. Prototype Implementation

Create prototype Java code in data-model/src/main/java/org/alfresco/repo/datamodel/nuxeo/:

Core Mapper Classes:

  • NuxeoDataModelMapper.java - Main mapper orchestrating transformations
  • AlfrescoToNuxeoTypeMapper.java - Maps Alfresco Types to Nuxeo Document Types
  • AlfrescoToNuxeoAspectMapper.java - Maps Alfresco Aspects to Nuxeo Schemas/Facets
  • AlfrescoToNuxeoPropertyMapper.java - Maps Alfresco Properties to Nuxeo Fields
  • AlfrescoToNuxeoAssociationMapper.java - Maps Alfresco Associations to Nuxeo Relations
  • DataTypeConverter.java - Converts between Alfresco and Nuxeo data types

Model Classes:

  • NuxeoDocumentType.java - Represents Nuxeo document type
  • NuxeoSchema.java - Represents Nuxeo schema
  • NuxeoFacet.java - Represents Nuxeo facet
  • NuxeoField.java - Represents Nuxeo field
  • MappingContext.java - Context holder for mapping configuration

Configuration:

  • mapping-config.properties - Configuration for custom mappings and rules

4. Test Cases

Create comprehensive tests in data-model/src/test/java/org/alfresco/repo/datamodel/nuxeo/:

  • NuxeoDataModelMapperTest.java - Integration tests
  • AlfrescoToNuxeoTypeMapperTest.java - Type mapping tests
  • AlfrescoToNuxeoAspectMapperTest.java - Aspect mapping tests
  • AlfrescoToNuxeoPropertyMapperTest.java - Property mapping tests
  • DataTypeConverterTest.java - Data type conversion tests

5. Example Mappings

Create example XML/JSON files showing real mapping scenarios:

  • examples/alfresco-content-model.xml - Sample Alfresco model
  • examples/nuxeo-document-type.json - Corresponding Nuxeo output
  • examples/mapping-report.md - Detailed mapping report

Implementation Guidelines

Alfresco Data Model Key Points:

  1. M2Model structure with namespaces, types, aspects, properties
  2. Types have single inheritance, properties, and associations
  3. Aspects provide reusable cross-cutting behaviors
  4. Properties support constraints, indexing, mandatory/multi-valued flags
  5. Associations include child (parent-child) and peer (non-hierarchical)
  6. Namespaces provide model isolation with URI and prefix

Nuxeo Data Model Key Points (from documentation):

  1. Document Types are hierarchical with single inheritance
  2. Schemas group related fields (similar to aspects conceptually)
  3. Facets provide reusable behaviors (mixins)
  4. Fields are typed properties within schemas
  5. Core Types: Document, File, Folder, etc.
  6. Relations for document associations

Mapping Strategy:

  • Alfresco Type → Nuxeo Document Type (with parent hierarchy preserved)
  • Alfresco Aspect → Nuxeo Facet + Schema (aspects become facets with associated schemas)
  • Alfresco Property → Nuxeo Field (with data type conversion)
  • Alfresco Child Association → Nuxeo parent-child relationship
  • Alfresco Peer Association → Nuxeo Relation
  • Alfresco Namespace → Nuxeo Schema prefix

Data Type Mapping:

Create mapping for common types:

  • d:text → string
  • d:int → long
  • d:boolean → boolean
  • d:date → date
  • d:datetime → date (with time)
  • d:content → blob
  • d:noderef → string (with validation)
  • d:qname → string
  • d:path → string
  • d:category → string
  • d:mltext → string (with i18n support)

Code Quality Requirements:

  • Well-documented Java code with JavaDoc
  • Follow existing Alfresco coding conventions
  • Include comprehensive error handling
  • Support logging for debugging
  • Make code extensible and configurable

Documentation Requirements:

  • Use markdown format for main documentation
  • Include diagrams (using mermaid syntax) where helpful
  • Provide code examples in documentation
  • Document all assumptions and limitations
  • List unresolved issues with severity levels

Expected File Structure

alfresco-community-repo/
├── docs/
│   └── investigation/
│       ├── ALFRESCO_NUXEO_DATA_MODEL_MAPPING.md
│       └── images/
│           └── data-model-comparison.png (if needed)
├── data-model/src/main/java/org/alfresco/repo/datamodel/nuxeo/
│   ├── NuxeoDataModelMapper.java
│   ├── mapper/
│   │   ├── AlfrescoToNuxeoTypeMapper.java
│   │   ├── AlfrescoToNuxeoAspectMapper.java
│   │   ├── AlfrescoToNuxeoPropertyMapper.java
│   │   └── AlfrescoToNuxeoAssociationMapper.java
│   ├── model/
│   │   ├── NuxeoDocumentType.java
│   │   ├── NuxeoSchema.java
│   │   ├── NuxeoFacet.java
│   │   └── NuxeoField.java
│   ├── converter/
│   │   └── DataTypeConverter.java
│   └── config/
│       ├── MappingContext.java
│       └── mapping-config.properties
├── data-model/src/test/java/org/alfresco/repo/datamodel/nuxeo/
│   ├── NuxeoDataModelMapperTest.java
│   ├── mapper/
│   │   ├── AlfrescoToNuxeoTypeMapperTest.java
│   │   ├── AlfrescoToNuxeoAspectMapperTest.java
│   │   └── AlfrescoToNuxeoPropertyMapperTest.java
│   └── converter/
│       └── DataTypeConverterTest.java
└── examples/
    ├── alfresco-content-model.xml
    ├── nuxeo-document-type.json
    └── mapping-report.md

Unresolved Issues to Investigate

Document these issues in the investigation report:

  1. Aspect vs Facet Semantics: How do mandatory aspects in Alfresco map to Nuxeo facets?
  2. Association Cardinality: Differences in how 1:1, 1:N, N:M relationships are handled
  3. Dynamic Aspect Application: Can Nuxeo facets be dynamically applied like Alfresco aspects?
  4. Constraint Enforcement: How do Alfresco constraints map to Nuxeo validation rules?
  5. Namespace Isolation: How to handle Alfresco's namespace model in Nuxeo?
  6. Multi-valued Properties: Are there limitations in Nuxeo for multi-valued fields?
  7. Property Inheritance: How property overrides work in both systems
  8. Archive and Soft Delete: Differences in handling archived content
  9. Indexing Configuration: How Alfresco's indexing options map to Nuxeo
  10. Custom Data Types: Can custom Alfresco data types be represented in Nuxeo?

Success Criteria

  • ✅ Complete investigation document with all sections filled
  • ✅ At least 10 entity mappings documented in tables
  • ✅ At least 20 property/field mappings with data type conversions
  • ✅ Working prototype code that can parse Alfresco M2Model XML
  • ✅ Working prototype code that generates Nuxeo schema definitions
  • ✅ At least 15 unit tests with >80% code coverage
  • ✅ Example files demonstrating real-world mapping scenarios
  • ✅ All unresolved issues documented with impact analysis
  • ✅ Code follows Alfresco conventions and includes JavaDoc
  • ✅ Documentation is clear, comprehensive, and actionable

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits November 26, 2025 06:54
Co-authored-by: SatyamSah5 <204130270+SatyamSah5@users.noreply.github.com>
Co-authored-by: SatyamSah5 <204130270+SatyamSah5@users.noreply.github.com>
Co-authored-by: SatyamSah5 <204130270+SatyamSah5@users.noreply.github.com>
…n, and remove duplicate facet

Co-authored-by: SatyamSah5 <204130270+SatyamSah5@users.noreply.github.com>
Copilot AI changed the title [WIP] Conduct investigation of Alfresco and Nuxeo data models Alfresco to Nuxeo data model mapping investigation and prototype Nov 26, 2025
Copilot finished work on behalf of SatyamSah5 November 26, 2025 07:10
Copilot AI requested a review from SatyamSah5 November 26, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants