About AEM Sling Models Extension
AEM Object Injector for Sling Models.
The AEM Object Injector for Sling Models provides:
- Access to PageManager, Page and TagManager objects
- Current WCM mode and Authoring UI mode
- Current Designer, Design and Style objects
- XSSAPI for current request
- CQ I18n object for the current request
- Granite Workflow Session
- Support injection request-derived context objects on all models, not only when the adaptable is a request
See Injector API documentation for details.
Comparison to ACS Commons
The ACS AEM Commons project also contains an implementation of an AEM Object Injector. It has basically the same feature-set as the wcm.io version, but it uses name-based injection based on field names.
The wcm.io AEM Object injector use class-based injection, making it easier to use independently from the field name. Since version 1.1 it supports more features than the ACS AEM Commons version.
Maven Dependency for CQ5
Although wcm.io generally targets only AEM6, for this package a version for CQ55 and CQ56 is published as well:
<dependency> <groupId>io.wcm.cq5</groupId> <artifactId>io.wcm.cq5.sling.models</artifactId> <version>1.0.0</version> </dependency>
It supports the same features, only the Authoring UI mode detection is not available.