This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Bloomreach Content Export/Import (Content-ExIm) Forge library, a comprehensive toolkit for importing and exporting content within Bloomreach Experience Manager (brXM).
Project Identity:
- Group ID:
org.onehippo.forge.content-exim - Version: 7.0.0-SNAPSHOT
- Parent:
hippo-cms7-release(version 16.3.0) - License: Apache 2.0
- Repository: https://github.com/bloomreach-forge/content-export-import
- Documentation: https://bloomreach-forge.github.io/content-export-import/
- Java Version: Java 17
The Content-ExIm project provides higher-level features for content import and export using:
- Hippo Workflow API: For workflow-level document management
- Hippo JCR POJO Binding Library: For lower-level JCR mappings and bindings
- Gallery Magick Image Processing: For thumbnail image generation
content-export-import/
├── core/ # Core import/export functionality
│ # JCR content access and processing
│ # Content transformation and validation
│
├── repository-jaxrs/ # JAX-RS REST API for content operations
│ # HTTP endpoints for import/export
│
├── demo/ # Demo applications and examples
│ # Sample import/export implementations
│ # Integration examples
│
├── updater-examples/ # Content updater examples
│ # Sample processors for content transformation
│
└── src/ # Root-level source files
# Build entire project (all modules)
mvn clean install
# Build without tests (faster)
mvn clean install -DskipTests
# Generate documentation locally
mvn clean install
mvn clean site
# Generate GitHub Pages documentation
mvn clean install
find docs -name "*.html" -exec rm {} \;
mvn -Pgithub.pages clean site# Core module only
cd core && mvn clean install
# Repository JAX-RS module only
cd repository-jaxrs && mvn clean install
# Demo module only
cd demo && mvn clean install
# Updater examples only
cd updater-examples && mvn clean install# Run all unit tests
mvn test
# Run tests in specific module
cd core && mvn test
cd repository-jaxrs && mvn test
cd demo && mvn test
# Run specific test class
mvn test -Dtest=ClassName
# Run specific test method
mvn test -Dtest=ClassName#methodName
# Run with debug output
mvn test -X# Generate aggregate Javadocs
mvn javadoc:javadoc
# Generate site documentation
mvn site
# Code quality analysis
mvn verifycontent-export-import/
├── core/ # Core import/export engine
│ ├── src/main/java/ # Java source code
│ ├── src/test/java/ # Unit tests
│ └── pom.xml
│
├── repository-jaxrs/ # JAX-RS REST API
│ ├── src/main/java/ # REST endpoint implementations
│ ├── src/test/java/ # API tests
│ └── pom.xml
│
├── demo/ # Demo applications
│ ├── src/main/java/ # Demo implementations
│ ├── src/test/java/ # Demo tests
│ └── pom.xml
│
├── updater-examples/ # Content updater examples
│ ├── src/main/java/ # Example updater implementations
│ └── pom.xml
│
├── src/ # Root-level integration
├── pom.xml # Master POM
├── README.md # Project README
├── LICENSE # Apache 2.0 License
└── NOTICE # License notices
- JCR Content Access: Direct interaction with Bloomreach repository
- Workflow Integration: Document lifecycle management via Hippo Workflow API
- POJO Binding: Automatic JCR-to-Java object mapping via Hippo POJO Bind library
- Content Validation: Data integrity checking and transformation
- Image Processing: Thumbnail generation with Gallery Magick
- REST API Pattern: HTTP endpoints for import/export operations
- JSON Serialization: Content representation in JSON format
- Request/Response Mapping: Conversion between HTTP and internal formats
- Reference Implementation: Example content import/export flows
- Integration Patterns: Best practices for using the libraries
- Test Data: Sample content for demonstration
- JCR: Apache Jackrabbit (via Bloomreach)
- Workflow: Hippo Workflow API
- POJO Binding: Hippo POJO Bind JCR library (3.1.0)
- Image Processing: Gallery Magick (4.1.0)
- REST Services: JAX-RS (likely Apache CXF)
- File Systems: Apache Commons VFS2 (2.10.0)
- Build: Apache Maven 3.x
- Java: Java 17+
- JUnit: Primary testing framework
- Mocking: Standard Java mocking libraries
- Assertions: AssertJ or similar
- Main branch:
develop(active development) - Release branches: For release versions
- Feature branches: For new features and fixes
- Parent POM: Uses
hippo-cms7-releasefor version management - Module Naming:
content-exim-{name}convention - API First: Public interfaces in dedicated modules
1. Adding Content Import Functionality:
- Define content mapping in core module
- Create POJO binding annotations
- Implement content validation logic
- Add workflow integration if needed
- Write unit tests for the import process
2. Adding Export Functionality:
- Define content extraction logic
- Implement serialization to output format (XML, JSON, etc.)
- Add content filtering and transformation
- Include thumbnail/asset handling
- Test with various content types
3. Creating REST API Endpoints:
- Define JAX-RS resource classes in repository-jaxrs
- Map HTTP requests to core functionality
- Implement request validation and error handling
- Document endpoints with Javadoc
4. Building Content Updaters:
- Extend updater-examples with custom logic
- Implement content transformation rules
- Add validation for transformed content
- Test with sample data from demo module
Unit Tests:
- Test core logic in isolation
- Mock JCR sessions and content
- Verify transformations and validations
- Test POJO binding mappings
Integration Tests:
- Test with actual content
- Verify workflow integration
- Test end-to-end import/export flows
- Validate REST API endpoints
Generate and view documentation locally:
mvn clean install
mvn clean site
# Open target/site/index.html in a browser- GitHub Pages: https://bloomreach-forge.github.io/content-export-import/
- Generated from master branch
- Includes API reference and usage guides
- Import/Export API reference
- REST endpoint documentation
- POJO binding configuration
- Content updater examples
- Integration guides with brXM
- Content Validation: Always validate imported content against business rules
- Error Handling: Gracefully handle malformed input and missing dependencies
- Performance: Consider batch operations for large content imports
- Backward Compatibility: Maintain compatibility across versions when possible
- Testing: Comprehensive testing with various content types and structures
- Don't skip content validation to improve performance
- Always handle missing or null properties gracefully
- Test with actual Bloomreach content types
- Consider workflow state transitions during import
- Validate permissions before attempting content operations
- Handle large binary assets efficiently
- Validate input at API boundaries
- Respect JCR security and permissions
- Sanitize content during import to prevent injection
- Secure REST endpoints appropriately
- Never commit credentials or sensitive data
cd core
# Read relevant files using Read tool
# Make changes using Edit tool
mvn test -Dtest=RelevantTest
mvn clean installcd repository-jaxrs
# Create new JAX-RS resource class
# Implement endpoint methods
mvn test
mvn clean installcd updater-examples
# Create new updater class implementing content transformation
# Add configuration and validation logic
mvn test
mvn clean install# From project root
mvn clean install -DskipTests # Fast build
# Or with tests
mvn clean installThe modules typically depend on each other in this order:
- core - Independent, core functionality
- repository-jaxrs - Depends on core
- updater-examples - Depends on core
- demo - May depend on core and others
# Run all tests
mvn test
# Run tests in specific module
mvn test -pl core
# Run specific test class
mvn test -Dtest=ImportTest
# Run specific test method
mvn test -Dtest=ImportTest#testImportContent
# Run with debug output
mvn test -XThe Content-ExIm library integrates with brXM in several ways:
- JCR Repository: Reads/writes content to the brXM JCR repository
- Workflow API: Manages document lifecycle and transitions
- Configuration: Uses brXM configuration for content types and validation rules
- Security: Respects brXM user permissions and security policies
- Plugins: Can be extended with custom plugins for specific content types
# Full clean build with tests
mvn clean install
# Build with all profiles
mvn clean install -Pall-profiles
# Generate documentation for release
mvn clean site
mvn -Pgithub.pages clean siteApache License 2.0 - Open Source