Emulators
- Topics:
- Developing
CREATED FOR:
- Developer
Adobe Experience Manager (AEM) enables authors to view a page in an emulator that simulates the environment in which an end-user will view the page, as for example on a mobile device or in an email client.
The AEM emulator framework:
- Provides content authoring within a simulated User Interface (UI), e.g. a mobile device or an email client (used to author newsletters).
- Adapts the page content according to the simulated UI.
- Allows the creation of custom emulators.
Emulators Characteristics
An emulator:
- Is based on ExtJS.
- Operates on the page DOM.
- Its appearance is regulated via CSS.
- Supports plugins (e.g. the mobile device rotation plugin).
- Is only active on author.
- Its base component is at
/libs/wcm/emulator/components/base
.
How the Emulator Transforms the Content
The emulator works by wrapping the HTML body contents into emulator DIVs. For example, the following html code:
<body>
<div id="wrapper" class="page mobilecontentpage ">
<div class="topnav mobiletopnav">
...
</div>
...
</div>
</body>
is transformed into the following html code after the start of the emulator:
<body>
<div id="cq-emulator-toolbar">
...
</div>
<div id="cq-emulator-wrapper">
<div id="cq-emulator-device">
<div class=" android vertical" id="cq-emulator">
...
<div class=" android vertical" id="cq-emulator-content">
...
<div id="wrapper" class="page mobilecontentpage">
...
</div>
...
</div>
</div>
</div>
</div>
...
</body>
Two div tags have been added:
-
the div with id
cq-emulator
holding the emulator as a whole and -
the div with id
cq-emulator-content
representing the device’s viewport/screen/content area where the page content resides.
New CSS classes are also assigned to the new emulator divs: they represent the name of the current emulator.
Plugins of an emulator may further extend the list of assigned CSS classes, as in the example of the rotation plugin, inserting a “vertical” or “horizontal” class depending on the current device rotation.
This way, the complete appearance of the emulator can be controlled by having CSS classes corresponding to the IDs and CSS classes of the emulator divs.
Mobile Emulators
The existing mobile emulators:
-
Are below /libs/wcm/mobile/components/emulators.
-
Are available via the JSON servlet at:
http://localhost:4502/bin/wcm/mobile/emulators.json
When the page component relies on the mobile page component ( /libs/wcm/mobile/components/page
), the emulator functionality is automatically integrated in the page through the following mechanism:
-
The mobile page component
head.jsp
includes the device group’s associated emulator init component (only in author mode) and the device group’s rendering CSS through:deviceGroup.drawHead(pageContext);
-
The method
DeviceGroup.drawHead(pageContext)
includes the emulator’s init component, i.e. calls theinit.html.jsp
of the emulator component. If the emulator component does not have its owninit.html.jsp
and relies on the mobile base emulator (wcm/mobile/components/emulators/base)
, the init script of the mobile base emulator is called (/libs/wcm/mobile/components/emulators/base/init.html.jsp
). -
The init script of the mobile base emulator defines through Javascript:
-
The configuration for all the emulators that are defined for the page (emulatorConfigs)
-
The emulator manager which integrates the emulator’s functionality in the page through:
emulatorMgr.launch(config)
;The emulator manager is defined by:
/libs/wcm/emulator/widgets/source/EmulatorManager.js
-
Creating a Custom Mobile Emulator
To create a custom mobile emulator:
-
Below
/apps/myapp/components/emulators
create the componentmyemulator
(node type:cq:Component
). -
Set the
sling:resourceSuperType
property to/libs/wcm/mobile/components/emulators/base
-
Define a CSS client library with category
cq.wcm.mobile.emulator
for the emulator appearance: name =css
, node type =cq:ClientLibrary
As an example, you can refer to the node
/libs/wcm/mobile/components/emulators/iPhone/css
-
If needed, define a JS client library, for example to define a specific plugin: name = js, node type = cq:ClientLibrary
As an example, you can refer to the node
/libs/wcm/mobile/components/emulators/base/js
-
If the emulator supports specific functionalities defined by plugins (like touch scrolling), create a configuration node below the emulator: name =
cq:emulatorConfig
, node type =nt:unstructured
and add the property that defines the plugin:-
Name =
canRotate
, Type =Boolean
, Value =true
: to include the rotation functionality. -
Name =
touchScrolling
, Type =Boolean
, Value =true
: to include the touch scrolling functionality.
More functionalities can be added by defining your own plugins.
-
Experience Manager
- Developing User Guide overview
- Introduction for Developers
- Getting Started Developing AEM Sites - WKND Tutorial
- AEM Core Concepts
- Structure of the AEM Touch-Enabled UI
- Concepts of the AEM Touch-Enabled UI
- AEM Development - Guidelines and Best Practices
- Using Client-Side Libraries
- Developing and Page Diff
- Editor Limitations
- The CSRF Protection Framework
- Data Modeling - David Nuescheler’s Model
- Contributing to AEM
- Security
- Reference Materials
- Create a Fully-Featured Website (Classic UI)
- Designs and the Designer (Classic UI)
- Platform
- Sling Cheatsheet
- Using Sling Adapters
- Tag Libraries
- Templates
- Using the Sling Resource Merger in AEM
- Overlays
- Naming Conventions
- Creating a New Granite UI Field Component
- Query Builder
- Tagging
- Customizing Pages shown by the Error Handler
- Custom Node Types
- Adding Fonts for Graphic-Rendering
- Connecting to SQL Databases
- Externalizing URLs
- Creating and Consuming Jobs for Offloading
- Configuring Cookie Usage
- How to programmatically access the AEM JCR
- Integrating Services with the JMX Console
- Developing the Bulk Editor
- Developing Reports
- eCommerce
- Components
- Core Components
- Style System
- Components Overview
- AEM Components - The Basics
- Developing AEM Components
- Developing AEM Components - Code Samples
- JSON Exporter for Content Services
- Enabling JSON Export for a Component
- Image Editor
- Decoration Tag
- Using Hide Conditions
- Configuring Multiple In-Place Editors
- Developer Mode
- Testing Your UI
- Components for Content Fragments
- Obtaining Page Information in JSON Format
- Internationalization
- Classic UI Components
- Headless Experience Management
- Headless and Hybrid with AEM
- Enabling JSON Export for a Component
- Single Page Applications
- SPA Introduction and Walkthrough
- SPA WKND Tutorial
- Getting Started with SPAs in AEM - React
- Getting Started with SPAs in AEM - Angular
- Implementing a React Component for SPA
- SPA Deep Dives
- SPA Editor Overview
- Developing SPAs for AEM
- SPA Blueprint
- SPA Page Component
- Dynamic Model to Component Mapping for SPAs
- SPA Model Routing
- SPA and Adobe Experience Platform Launch Integration
- SPA and Server-Side Rendering
- SPA Reference Materials
- HTTP API
- Content Fragments
- Experience Fragments
- Development Tools
- Development Tools
- AEM Modernization Tools
- Dialog Editor
- Dialog Conversion Tool
- Developing with CRXDE Lite
- Managing Packages Using Maven
- How to Develop AEM Projects Using Eclipse
- How to Build AEM Projects using Apache Maven
- How to Develop AEM Projects using IntelliJ IDEA
- How to use the VLT Tool
- How to use the Proxy Server Tool
- AEM Brackets Extension
- AEM Developer Tools for Eclipse
- AEM Repo Tool
- Personalization
- Extending AEM
- Customizing Page Authoring
- Customizing the Consoles
- Customizing Views of Page Properties
- Configuring your Page for Bulk Editing of Page Properties
- Customizing and Extending Content Fragments
- Extending Workflows
- Extending the Multi Site Manager
- Tracking and Analytics
- Cloud Services
- Creating Custom Extensions
- Forms
- Integrating Services with the JMX Console
- Developing the Bulk Editor
- Extending Classic UI
- Testing
- Best Practices
- Best Practices Overview
- AEM Development Guidelines and Best Practices
- Development Best Practices
- Content Architecture
- Software Architecture
- We.Retail Reference Implementation
- We.Retail Reference Implementation
- Trying out Content Fragments in We.Retail
- Trying out Core Components in We.Retail
- Trying out Editable Templates in We.Retail
- Trying out Responsive Layout in We.Retail
- Trying out the Globalized Site Structure in We.Retail
- Trying out Experience Fragments in We.Retail
- Coding Tips
- Code pitfalls
- OSGI Bundles
- JCR Integration
- Code Samples
- Troubleshooting Slow Queries
- Mobile Web
The Perfect Blend: A New Era of Collaboration with AEM and Workfront
Adobe Customer Success Webinars
Wednesday, Apr 2, 5:00 PM UTC
Explore how Adobe Experience Manager and Workfront integrate to help teams move from ideation to delivery without the usual bottlenecks, ensuring content is organized, on-brand, and ready to go live faster.
RegisterThe True Cost of a Failed Implementation
A failed implementation isn’t just an inconvenience — it costs real revenue. Poor execution and misaligned tools disrupt pipelines,...
Wed, Mar 19, 2:00 PM PDT (9:00 PM UTC)
B2B Reimagined: Transforming Go-to-Market Strategies for Profitable Growth
B2B brands are facing a digital revolution. Buyers expect hyper-relevant content and self-service, while internally AI is transforming...
Wed, Mar 19, 1:00 PM PDT (8:00 PM UTC)
Connect with Experience League at Summit!
Get front-row access to top sessions, hands-on activities, and networking—wherever you are!
Learn more