SlideShare a Scribd company logo
APACHE SLING & FRIENDS TECH MEETUP
10-12 SEPTEMBER 2018
Migrating a large AEM project to Touch UI
António Ribeiro & Gregor Zurowski (Mercedes-Benz.io)
2
Introduction
About Us
3
GREGOR ZUROWSKI ANTÓNIO RIBEIRO
Germany Portugal
About Our Project
4
§ Global CMS for all Mercedes-Benz product sites
§ https://www.mercedes-benz.co.uk
§ https://www.mercedes-benz.de
§ https://www.mercedes-benz.pt
§ + 53 other countries by end of 2018
§ Project inception in 2014
§ Started on AEM 6.0
§ Currently running on AEM 6.3 and upgrading to 6.4 shortly
5
Touch UI Migration
Touch UI Migration Scope
6
§ Started migrating to Touch UI in early 2018
§ Project scope
§ 80+ page components
§ 140+ components
§ 50+ AEM customizations
§ Custom widgets
§ Overlays
§ SiteAdmin/DAMAdmin/Sidekick extensions
§ Presentation scope: dialogs
How is Touch UI different? (1/2)
7
Touch UIClassic UI
How is Touch UI different? (2/2)
8
§ UI interfaces in AEM, including components and dialogs, are declaratively
described by nodes and properties
§ Similar structure with different node types and different wrapper nodes
Touch UIClassic UI
Classic UI Architecture (1/3)
9
§ UI components are only partly defined in the
repository
§ xtypes are defined in JavaScript sources
§ Client requests component definition as JSON
from server (“pull”)
§ Client is responsible for dynamically creating
UI components
Classic UI Architecture (2/3)
10
/component
/dialog
OK
textfield (xtype)
custom (xtype)
Client
Lib #1
Client
Lib #2
JCRExt Dialog
Nodes,
properties
& clientlibs
Classic UI Architecture (3/3)
11
:Browser :AEM :JCR
GET /dialog.json
read nodes
JSON
“pull”
render
Touch UI Architecture (1/3)
12
§ All Touch UI components defined in the
repository
§ Every component is a Sling resource
§ Client requests page with UI
§ Server sends UI as HTML documents using Coral
UI HTML5 web components (“push”)
§ “Dumb” client with fewer responsibilities
/libs/granite/ui
/textfield
/apps/daimler/ui
/custom
Touch UI Architecture (2/3)
13
/component
/cq:dialogtextfield (resourceType)
custom (resourceType)
JCRTouch UI Dialog
everything
is a
resource
Touch UI Architecture (3/3)
14
:Browser :AEM :JCR
GET /dialog.html
resolve dialog
HTML
resolve components
render
“push”
Summary of Differences
15
Classic UI Touch UI
Dialog nodes § name: dialog
§ jcr:primaryType: cq:Dialog
§ name: cq:dialog
§ jcr:primaryType: nt:unstructured
Sling resources sling:resourceType not used sling:resourceType
cq/gui/components/authoring/dialog
JavaScript
location
Imperative parts are directly
embedded using listeners or
managed in clientlibs.
Imperative parts cannot be embedded
in dialog definition (separation of
responsibilities)
Event handling Dialog widgets directly reference JS
code
JS observes dialog events
Classic UI Event Handling
16
OK
textfield (xtype)
custom (xtype)
Ext Dialog
load
change
submit
<<listener>>
<<listener>>
embedded
JavaScript
<<listener>>
Touch UI Event Handling
17
(id=dialog1)
textfield (id=text1)
custom (id=custom1)
$(dialog1)
{…}
$(sub1)
{…}
.on(submit)
.on(ready)
$(text1)
{…}
.on(change)
event
observation
Touch UI Dialog Component ClientLib
Touch UI Event Handling Implementation (1/2)
18
§ Need to create hook-in points for observation
§ Uniquely identify components with granite:id
that translate into HTML ID attributes
§ Apply common behavior to a set of
components with granite:class that translate
into HTML class attributes
Touch UI Event Handling Implementation (2/2)
19
<coral-fileupload
id="touchui-dialog-imagetab-image"
class="coral-Form-field cq-FileUpload …"
name="./image/file" […]>
[…]
</coral-fileupload>
HTML
granite:class
granite:id
Validation (1/3)
20
§ Validation in Classic UI and Touch UI is purely
done on the client side
§ Classic UI vtypes can no longer be used
§ Touch UI provides form validation with
Granite UI foundation-validation
Validation (2/3)
21
<component1 … validation="uppercase">
Dialog
var registry = $(window).adaptTo('foundation-registry');
registry.register('foundation.validation.validator', {
selector: '[data-foundation-validation*=uppercase]',
validate: function (element) {
return checkUpperCase($(element));
}
});
JavaScript
Validation (3/3)
22
§ Possibility to simply combine multiple validations per
component in Touch UI
<textfield1 …
validation="uppercase,maxlength">
§ In Classic UI only one vtype per widget
<textfield2 …
vtype=”mycomponent-composite-validation">
§ Simple mandatory field validation using required
attribute, but issues with some components
<textfield3 …
required="{Boolean}true">
Custom Component Properties (1/2)
23
§ Components need additional properties that
are not available in the default configuration
§ Use granite:data properties that get
translated into HTML data attributes
§ Use case example:
§ Maximum number of allowed elements within a
multifield component
<multifield1 …
<granite:data
jcr:primaryType="nt:unstructured"
max-items="{Long}4"/>
</multifield1>
Custom Component Properties (2/2)
24
Dialog
<coral-multifield … data-max-items="4">
HTML
var maxItems = $multifield1.data('max-items');
JavaScript
Customizations
25
§ Two approaches for customizing UI components
§ Overlaying (“replacing”/ “hiding”)
§ Works in Classic UI and Touch UI
§ Place overlays in corresponding /apps component path taking
precedence over /libs
§ Be aware of “sustainable upgrades” introduced with AEM 6.4
§ Overriding (“inheriting”)
§ Classic UI: Widget inheritance using CQ.Ext.extend()
§ Touch UI: Sling Resource Merger using sling:resourceSuperType
§ Parent component remains as-is
§ Need to sync changes coming from newer versions and patches
Customization Example Using Overrides
26
Use case: Create multifield component using an alternative
persistence format based on the existing Granite multifield
component.
<<Component>>
granite/ui/multifield
render.jsp
<<Component>>
daimler/ui/multifield
render.jsp*
sling:
resourceSuperType
27
Touch UI Migration Approach
Migration Approach – User Interfaces
28
§ Both Classic UI and Touch UI interfaces coexist
§ Introduce changes in stages
§ Test migration before final switch over
§ Extending testing period without affecting users
§ No parallel integration branches
§ No painful branch tracking/merging
§ Allows multi-staged user training in our international
context
Migration Approach – Data Structures
29
§ Existing content data structure remains
untouched
§ No “big bang” data migration
§ Needs some extra tweaks to accommodate this
requirement
§ Example: multifield that supports “JSON” structure
Migration Approach – JavaScript Code
30
§ Touch UI and Classic UI JavaScript code co-exist
§ Manage each in separate clientlibs
§ Prevent colliding behavior
§ Classic UI code must not assume it’s running in Classic
exclusively
§ Potentially runs in Touch UI Classic dialog fallback mode
§ Add safe-guards in existing code to prevent from running in
wrong mode
31
Recommendations & Best Practices
Recommendations & Best Practices (1/2)
32
§ Start with conversion of simple component dialogs
§ Gradually convert more complex components
§ Event handling
§ Validations
§ Custom component-specific clientlibs
§ Convert dialogs with the AEM Dialog Conversion Tool
§ has limited functionality, but good to start with
Recommendations & Best Practices (2/2)
33
§ Avoid Coral 2 components (soon deprecated)
§ Coral 2: granite/ui/components/foundation/form/textfield
§ Coral 3: granite/ui/components/coral/foundation/form/textfield
§ Avoid deprecated Coral 3 components
§ Example: pathbrowser deprecated with AEM 6.3
§ Behavior of components can break with product updates
§ Example: customized assetdetails stopped working after AEM 6.3
SP2
§ Check release notes
Pain Points and Room for Improvement
34
§ Richtext (RTE) component with numerous problems
§ Validation not working as expected
§ Various rendering issues (fix in future releases)
§ Use of sling:hideResource causing inheritance locks to
disappear
§ Dialog layout problems
§ Example: Tooltips overflow dialog frames
§ unable to use workaround due to AEM “sustainable
upgrades”
35
Thank You.
References
36
§ Adobe Granite UI documentation:
https://adobe.ly/2QetbPf
§ Granite foundation-validation documentation:
https://adobe.ly/2Nrn5MR
§ Coral 3 component documentation:
https://adobe.ly/2McKlcI
§ Dialog Conversion Tool: https://adobe.ly/2O0M9HF
§ Sustainable upgrades: https://adobe.ly/2MZVFhO
Appendix 1: Touch UI Component Example (1/2)
37
<%
AttrBuilder attrs = tag.getAttrs();
cmp.populateCommonAttrs(attrs);
[...]
%>
<coral-fileupload <%= attrs.build() %>
[...]
</coral-fileupload>
render.jsp
Appendix 1: Touch UI Component Example (2/2)
38
<coral-fileupload
class="coral-Form-field cq-FileUpload …"
id="touchui-dialogimagetab-image"
name="./image/file"
data-foundation-validation="dd-image"
accept="image/jpeg,image/png"
action="/content/…/teaserelement_9c21” […]>
[…]
</coral-fileupload>
HTML
Appendix 2: Naming Conventions
39
Create naming conventions for Component IDs
§ Readable naming structure
§ Easily control JavaScript observation
§ Components must have unique IDs for component-specific behavior
§ IDs should contain common “parts” for applying shared behavior (as
an alternative to using granite:class).
touchui-<component-type>-<component-name>[-<…>]
§ Example: touchui-dialog-calltoaction-button
§ Apply notifications on touchui-dialog-*
§ Apply click event on touchui-*-calltoaction-button
Appendix 2: Naming Conventions Example
40
#touchui-dialog-video
#touchui-dialog-video-tab-general
#touchui-dialog-video-tab-general-
title
Video Dialog
General
textfield (xtype)
Dialog Definition Component IDs

More Related Content

What's hot

Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Philipp Burgmer
 
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
Carl Tyler
 
Social Enabler for XPages
Social Enabler for XPagesSocial Enabler for XPages
Social Enabler for XPages
Niklas Heidloff
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and Scala
Joonas Lehtinen
 
Integrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalIntegrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere Portal
Himanshu Mendiratta
 
React & Redux in Hulu
React & Redux in HuluReact & Redux in Hulu
React & Redux in Hulu
Morgan Cheng
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
Joonas Lehtinen
 
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPagesBP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
Paul Withers
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
Claudio Procida
 
SharePoint Web part programming
SharePoint Web part programmingSharePoint Web part programming
SharePoint Web part programming
Quang Nguyễn Bá
 
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
William Holmes
 
Transforming the web into a real application platform
Transforming the web into a real application platformTransforming the web into a real application platform
Transforming the web into a real application platform
Mohanadarshan Vivekanandalingam
 
1812 icap-v1.3 0430
1812 icap-v1.3 04301812 icap-v1.3 0430
1812 icap-v1.3 0430
Rohit Kelapure
 
MAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - DownloadableMAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - Downloadable
paulbastide
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
JooinK
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
Droidcon Spain
 
Liberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_steLiberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_ste
Rohit Kelapure
 

What's hot (17)

Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
 
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
AD109 - Using the IBM Sametime Proxy SDK: WebSphere Portal, IBM Connections -...
 
Social Enabler for XPages
Social Enabler for XPagesSocial Enabler for XPages
Social Enabler for XPages
 
Html5 with Vaadin and Scala
Html5 with Vaadin and ScalaHtml5 with Vaadin and Scala
Html5 with Vaadin and Scala
 
Integrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere PortalIntegrate any Angular Project into WebSphere Portal
Integrate any Angular Project into WebSphere Portal
 
React & Redux in Hulu
React & Redux in HuluReact & Redux in Hulu
React & Redux in Hulu
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPagesBP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
SharePoint Web part programming
SharePoint Web part programmingSharePoint Web part programming
SharePoint Web part programming
 
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
IBM Lotusphere 2012 AD205 - IBM Sametime® in IBM Connections®, IBM WebSphere®...
 
Transforming the web into a real application platform
Transforming the web into a real application platformTransforming the web into a real application platform
Transforming the web into a real application platform
 
1812 icap-v1.3 0430
1812 icap-v1.3 04301812 icap-v1.3 0430
1812 icap-v1.3 0430
 
MAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - DownloadableMAS202 - Customizing IBM Connections - Downloadable
MAS202 - Customizing IBM Connections - Downloadable
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Cordova 3, apps para android
Cordova 3, apps para androidCordova 3, apps para android
Cordova 3, apps para android
 
Liberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_steLiberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_ste
 

Similar to Migrating a Large AEM Project to Touch UI

Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
Andrei Sebastian Cîmpean
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
Amir Zuker
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010
Patrick Lauke
 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Haytham Ghandour
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
akqaanoraks
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007
lucclaes
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
Association Paris-Web
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
James Williams
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in Gutenberg
Felix Arntz
 
Techdays 2011 - Things I will remember
Techdays 2011 - Things I will rememberTechdays 2011 - Things I will remember
Techdays 2011 - Things I will remember
Alexander Vanwynsberghe
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
banq jdon
 
Gwt Deep Dive
Gwt Deep DiveGwt Deep Dive
Gwt Deep Dive
Return on Intelligence
 
Twelve Tasks Made Easier with IBM Domino XPages
Twelve Tasks Made Easier with IBM Domino XPagesTwelve Tasks Made Easier with IBM Domino XPages
Twelve Tasks Made Easier with IBM Domino XPages
Teamstudio
 
Magento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASSMagento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASS
Bartek Igielski
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté
 
Flex for enterprise applications
Flex for enterprise applicationsFlex for enterprise applications
Flex for enterprise applications
darshanvartak
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
NAVER D2
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
sullis
 

Similar to Migrating a Large AEM Project to Touch UI (20)

Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010
 
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
Best Practices & Lessons Learned from the field on EMC Documentum xCP 2.0
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Google Dev Day2007
Google Dev Day2007Google Dev Day2007
Google Dev Day2007
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in Gutenberg
 
Techdays 2011 - Things I will remember
Techdays 2011 - Things I will rememberTechdays 2011 - Things I will remember
Techdays 2011 - Things I will remember
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
Gwt Deep Dive
Gwt Deep DiveGwt Deep Dive
Gwt Deep Dive
 
Twelve Tasks Made Easier with IBM Domino XPages
Twelve Tasks Made Easier with IBM Domino XPagesTwelve Tasks Made Easier with IBM Domino XPages
Twelve Tasks Made Easier with IBM Domino XPages
 
Magento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASSMagento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASS
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Flex for enterprise applications
Flex for enterprise applicationsFlex for enterprise applications
Flex for enterprise applications
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Android - Open Source Bridge 2011
Android - Open Source Bridge 2011Android - Open Source Bridge 2011
Android - Open Source Bridge 2011
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 

Migrating a Large AEM Project to Touch UI

  • 1. APACHE SLING & FRIENDS TECH MEETUP 10-12 SEPTEMBER 2018 Migrating a large AEM project to Touch UI António Ribeiro & Gregor Zurowski (Mercedes-Benz.io)
  • 3. About Us 3 GREGOR ZUROWSKI ANTÓNIO RIBEIRO Germany Portugal
  • 4. About Our Project 4 § Global CMS for all Mercedes-Benz product sites § https://www.mercedes-benz.co.uk § https://www.mercedes-benz.de § https://www.mercedes-benz.pt § + 53 other countries by end of 2018 § Project inception in 2014 § Started on AEM 6.0 § Currently running on AEM 6.3 and upgrading to 6.4 shortly
  • 6. Touch UI Migration Scope 6 § Started migrating to Touch UI in early 2018 § Project scope § 80+ page components § 140+ components § 50+ AEM customizations § Custom widgets § Overlays § SiteAdmin/DAMAdmin/Sidekick extensions § Presentation scope: dialogs
  • 7. How is Touch UI different? (1/2) 7 Touch UIClassic UI
  • 8. How is Touch UI different? (2/2) 8 § UI interfaces in AEM, including components and dialogs, are declaratively described by nodes and properties § Similar structure with different node types and different wrapper nodes Touch UIClassic UI
  • 9. Classic UI Architecture (1/3) 9 § UI components are only partly defined in the repository § xtypes are defined in JavaScript sources § Client requests component definition as JSON from server (“pull”) § Client is responsible for dynamically creating UI components
  • 10. Classic UI Architecture (2/3) 10 /component /dialog OK textfield (xtype) custom (xtype) Client Lib #1 Client Lib #2 JCRExt Dialog Nodes, properties & clientlibs
  • 11. Classic UI Architecture (3/3) 11 :Browser :AEM :JCR GET /dialog.json read nodes JSON “pull” render
  • 12. Touch UI Architecture (1/3) 12 § All Touch UI components defined in the repository § Every component is a Sling resource § Client requests page with UI § Server sends UI as HTML documents using Coral UI HTML5 web components (“push”) § “Dumb” client with fewer responsibilities
  • 13. /libs/granite/ui /textfield /apps/daimler/ui /custom Touch UI Architecture (2/3) 13 /component /cq:dialogtextfield (resourceType) custom (resourceType) JCRTouch UI Dialog everything is a resource
  • 14. Touch UI Architecture (3/3) 14 :Browser :AEM :JCR GET /dialog.html resolve dialog HTML resolve components render “push”
  • 15. Summary of Differences 15 Classic UI Touch UI Dialog nodes § name: dialog § jcr:primaryType: cq:Dialog § name: cq:dialog § jcr:primaryType: nt:unstructured Sling resources sling:resourceType not used sling:resourceType cq/gui/components/authoring/dialog JavaScript location Imperative parts are directly embedded using listeners or managed in clientlibs. Imperative parts cannot be embedded in dialog definition (separation of responsibilities) Event handling Dialog widgets directly reference JS code JS observes dialog events
  • 16. Classic UI Event Handling 16 OK textfield (xtype) custom (xtype) Ext Dialog load change submit <<listener>> <<listener>> embedded JavaScript <<listener>>
  • 17. Touch UI Event Handling 17 (id=dialog1) textfield (id=text1) custom (id=custom1) $(dialog1) {…} $(sub1) {…} .on(submit) .on(ready) $(text1) {…} .on(change) event observation Touch UI Dialog Component ClientLib
  • 18. Touch UI Event Handling Implementation (1/2) 18 § Need to create hook-in points for observation § Uniquely identify components with granite:id that translate into HTML ID attributes § Apply common behavior to a set of components with granite:class that translate into HTML class attributes
  • 19. Touch UI Event Handling Implementation (2/2) 19 <coral-fileupload id="touchui-dialog-imagetab-image" class="coral-Form-field cq-FileUpload …" name="./image/file" […]> […] </coral-fileupload> HTML granite:class granite:id
  • 20. Validation (1/3) 20 § Validation in Classic UI and Touch UI is purely done on the client side § Classic UI vtypes can no longer be used § Touch UI provides form validation with Granite UI foundation-validation
  • 21. Validation (2/3) 21 <component1 … validation="uppercase"> Dialog var registry = $(window).adaptTo('foundation-registry'); registry.register('foundation.validation.validator', { selector: '[data-foundation-validation*=uppercase]', validate: function (element) { return checkUpperCase($(element)); } }); JavaScript
  • 22. Validation (3/3) 22 § Possibility to simply combine multiple validations per component in Touch UI <textfield1 … validation="uppercase,maxlength"> § In Classic UI only one vtype per widget <textfield2 … vtype=”mycomponent-composite-validation"> § Simple mandatory field validation using required attribute, but issues with some components <textfield3 … required="{Boolean}true">
  • 23. Custom Component Properties (1/2) 23 § Components need additional properties that are not available in the default configuration § Use granite:data properties that get translated into HTML data attributes § Use case example: § Maximum number of allowed elements within a multifield component
  • 24. <multifield1 … <granite:data jcr:primaryType="nt:unstructured" max-items="{Long}4"/> </multifield1> Custom Component Properties (2/2) 24 Dialog <coral-multifield … data-max-items="4"> HTML var maxItems = $multifield1.data('max-items'); JavaScript
  • 25. Customizations 25 § Two approaches for customizing UI components § Overlaying (“replacing”/ “hiding”) § Works in Classic UI and Touch UI § Place overlays in corresponding /apps component path taking precedence over /libs § Be aware of “sustainable upgrades” introduced with AEM 6.4 § Overriding (“inheriting”) § Classic UI: Widget inheritance using CQ.Ext.extend() § Touch UI: Sling Resource Merger using sling:resourceSuperType § Parent component remains as-is § Need to sync changes coming from newer versions and patches
  • 26. Customization Example Using Overrides 26 Use case: Create multifield component using an alternative persistence format based on the existing Granite multifield component. <<Component>> granite/ui/multifield render.jsp <<Component>> daimler/ui/multifield render.jsp* sling: resourceSuperType
  • 28. Migration Approach – User Interfaces 28 § Both Classic UI and Touch UI interfaces coexist § Introduce changes in stages § Test migration before final switch over § Extending testing period without affecting users § No parallel integration branches § No painful branch tracking/merging § Allows multi-staged user training in our international context
  • 29. Migration Approach – Data Structures 29 § Existing content data structure remains untouched § No “big bang” data migration § Needs some extra tweaks to accommodate this requirement § Example: multifield that supports “JSON” structure
  • 30. Migration Approach – JavaScript Code 30 § Touch UI and Classic UI JavaScript code co-exist § Manage each in separate clientlibs § Prevent colliding behavior § Classic UI code must not assume it’s running in Classic exclusively § Potentially runs in Touch UI Classic dialog fallback mode § Add safe-guards in existing code to prevent from running in wrong mode
  • 32. Recommendations & Best Practices (1/2) 32 § Start with conversion of simple component dialogs § Gradually convert more complex components § Event handling § Validations § Custom component-specific clientlibs § Convert dialogs with the AEM Dialog Conversion Tool § has limited functionality, but good to start with
  • 33. Recommendations & Best Practices (2/2) 33 § Avoid Coral 2 components (soon deprecated) § Coral 2: granite/ui/components/foundation/form/textfield § Coral 3: granite/ui/components/coral/foundation/form/textfield § Avoid deprecated Coral 3 components § Example: pathbrowser deprecated with AEM 6.3 § Behavior of components can break with product updates § Example: customized assetdetails stopped working after AEM 6.3 SP2 § Check release notes
  • 34. Pain Points and Room for Improvement 34 § Richtext (RTE) component with numerous problems § Validation not working as expected § Various rendering issues (fix in future releases) § Use of sling:hideResource causing inheritance locks to disappear § Dialog layout problems § Example: Tooltips overflow dialog frames § unable to use workaround due to AEM “sustainable upgrades”
  • 36. References 36 § Adobe Granite UI documentation: https://adobe.ly/2QetbPf § Granite foundation-validation documentation: https://adobe.ly/2Nrn5MR § Coral 3 component documentation: https://adobe.ly/2McKlcI § Dialog Conversion Tool: https://adobe.ly/2O0M9HF § Sustainable upgrades: https://adobe.ly/2MZVFhO
  • 37. Appendix 1: Touch UI Component Example (1/2) 37 <% AttrBuilder attrs = tag.getAttrs(); cmp.populateCommonAttrs(attrs); [...] %> <coral-fileupload <%= attrs.build() %> [...] </coral-fileupload> render.jsp
  • 38. Appendix 1: Touch UI Component Example (2/2) 38 <coral-fileupload class="coral-Form-field cq-FileUpload …" id="touchui-dialogimagetab-image" name="./image/file" data-foundation-validation="dd-image" accept="image/jpeg,image/png" action="/content/…/teaserelement_9c21” […]> […] </coral-fileupload> HTML
  • 39. Appendix 2: Naming Conventions 39 Create naming conventions for Component IDs § Readable naming structure § Easily control JavaScript observation § Components must have unique IDs for component-specific behavior § IDs should contain common “parts” for applying shared behavior (as an alternative to using granite:class). touchui-<component-type>-<component-name>[-<…>] § Example: touchui-dialog-calltoaction-button § Apply notifications on touchui-dialog-* § Apply click event on touchui-*-calltoaction-button
  • 40. Appendix 2: Naming Conventions Example 40 #touchui-dialog-video #touchui-dialog-video-tab-general #touchui-dialog-video-tab-general- title Video Dialog General textfield (xtype) Dialog Definition Component IDs