How adobe-consulting-services/acs-aem-samples works
Project type and purpose
• This is an Adobe Experience Manager (AEM) “reference‐implementation” multi-module Maven project that ships:
• An OSGi bundle of Java samples (core)
• A content package with repository structure (repository-structure)
• A content package of UI components, clientlibs and OSGi configs (ui.apps)
• An “all” aggregator package that pulls them together
• Its sole purpose is to demonstrate common AEM building blocks (Sling servlets, OSGi services, filters, workflows, resource providers, etc.) for educational/reference use.
File structure
• Top-level parent POM manages four submodules: all, core, repository-structure, ui.apps
• core/src/main/java/... contains dozens of sample OSGi components (services, servlets, filters, event emitters, jobs, authentication handlers, adapter factories, Sling Models, etc.)
• ui.apps/src/main/content/jcr_root/apps/acs-aem-samples houses:
• HTL components (structure, content, utilities)
• Client libraries (authoring, base, common, vendor)
• Touch-UI datasource JSPs
• OSGi configuration under /apps/.../config and config.author
• repository-structure defines initial JCR paths/content for certain samples
• all assembles all content under one package for easy deployment
README
• Confirms this is a collection of sample implementations for common AEM building blocks
• Not meant for production—only reference
Main components and their relationships
A. Build & Deployment (Maven multi-module)
• Parent POM orchestrates compilation of:
– core → OSGi bundle (jar)
– ui.apps → content package (zip)
– repository-structure → content package (zip)
– all → aggregator package containing the above
• CI/CD (e.g., Jenkins or Cloud Manager) triggers mvn clean install -PautoInstallPackage against an AEM instance
B. AEM Instance (Author/Publish)
1. OSGi Container (Apache Felix)
– Deploy core bundle → SampleExecutor, SampleServices, SampleServlets, Filters, Event Emitters, Job Consumers, Workflow Processors, etc.
– OSGi Config factory → OSGI configs under ui.apps
2. JCR Repository (Apache Jackrabbit Oak)
– /apps/acs-aem-samples → HTL component definitions, clientlibs, touch-UI definitions
– /etc/workflow/models or /var/workflow within repository-structure
3. Sling Request Processing
– HTTP request → Sling Filters (SampleSlingRequestFilter, SampleServletFilter) → Sling Resource resolution → Sling Servlet
– Servlets return HTML/JSON (SampleAllMethodsServlet, SampleOptingServlet) or workflow/process results
4. Auxiliary Frameworks
– Sling Models (SampleSlingModel, exporters) for MVC
– QueryBuilder sample predicates & JSON hit writers
– OAuth scope/sample authentication handler
– Resource Providers & Decorators
– OSGi Job Handling (Sling Job)
– OSGi Event service
Architectural patterns & design principles
• Modular OSGi bundles, strict separation of concerns
• MVC via Sling Models + HTL components
• Content Repository as configuration + UI store
• Use of OSGi Declarative Services for dynamic service wiring
• Sling Filters/Servlets as request pipeline
• CQ/Granite workflow process implementations to illustrate JCR-backed workflow steps
• Related components under “OSGi,” “JCR,” and “Build” layers
By breaking this ACS AEM Samples project into:
1) Maven modules → build artifacts
2) AEM runtime layers (OSGi, Sling, JCR)
3) Sample‐specific subcomponents (filters, servlets, services, workflows, clientlibs)