Transcript
Page 1: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 1

USER INTERFACE CUSTOMIZAT ION FOR AEM 6

P R E S E N T E D B Y

Damien Antipa

Gilles Knobloch

November 18th, 2014

Page 2: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 2

Working on AEM/Granite/Coral and

wherever Javascript is used

4 years of AEM experience

Working on AEM/Granite/Coral

Architect of the Launches & Sling Resource Merger

Damien Antipa, Senior UX Engineer

Gilles Knobloch, Engineering Manager

@visiongeist

@gilknob

Page 3: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 3

Introduction

New user experience introduced in 5.6.0

Challenges

- Extensible technology for partners/customers

- Guarantee upgradability

Goal of the session

Understand how to extend admin screens and page authoring

Page 4: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 4

Extend

Admin screensCreate

Admin screens

Page

Authoring

Page 5: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 5

Fundamental Concepts

- UI based on content nodes

- Sling Resource Merger

- Granite UI Include

Page 6: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

/libs

/wcm

/core

/content

/siteadmin

6

How were you used to overlay?

/new-feature

/custom-feature

- All properties duplicated

- Blocking for upgrades

/apps/wcm/core/content/siteadmin

- Currently, need to copy

the whole subtree

Page 7: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

/libs

/wcm

/core

/content

/sites

7

How does it work now?

/new-feature

/custom-feature

(/new-feature)

/apps/wcm/core/content/sites

- Extend within an

almost empty sub-

tree

- Only needed

nodes/properties need to

be overlaid

Page 8: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 8

Sling Resource Merger

- Custom resource provider: /mnt/overlay

- Overlays of resources using resource resolver search paths

- Working as a diff

- Custom Sling vocabulary

Overall goal: override in /apps, never touch /libs

- Guarantees upgradability

- Easier debugging

Page 9: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 9

Sling Resource Merger

Add or override a property

Create the corresponding node structure and property within /apps(the property will have priority based on Sling Resource Resolver configuration)

Changing the type of the property is supported

Page 10: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 10

Sling Resource Merger

Hide one or more properties

Create the corresponding node structure and property within /apps,

Add sling:hideProperties property: list of properties to hide (String[])

* wildcard can be used to hide all properties

Page 11: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 11

Sling Resource Merger

Hide a resource (and its children)

Create the corresponding node structure within /apps

Set sling:hideResource to true (Boolean)

Page 12: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 12

Sling Resource Merger

Hide children of a resource (but keep the properties of the resource)

Create the corresponding node structure within /apps,

Add sling:hideChildren property: list of children to hide (String[])

* wildcard can be used to hide all children

Page 13: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 13

Sling Resource Merger

Reorder resources

Create the corresponding node within /apps

Set sling:orderBefore to the name of the sibling where

that node should be reordered before (String)

Page 14: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Extend existing admin screen

Check our examples!

- Custom documentation links

(sling:hideChildren, sling:orderBefore)

- Additional toolbar action

- Restrict Create Site to administrators

(sling:hideProperties, custom rendering condition)

- Default layout to list view, removed toggle to card view

(sling:hideResource)

Page 15: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Create a custom admin screen

Launches Console

- Custom console

- Custom menu entry

- Specific actions

Page 16: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 16

Create a custom admin screen

Root space

for Launches

console

Granite UI page resourcePage definition

Custom components (styles, scripts, JSPs)

Page 17: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 17

Create a custom admin screen

Add in

navigationGive same ID as your console and point

to it

Specify location in the tree

Extend navigation

Page 18: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 18

Granite UI Includes

granite/ui/components/foundation/include

Can be used to extend component dialogs

Avoid duplicating

same subtrees of

nodes

/apps/one /apps/two

/apps/commo

n

Specify path to

include

Page 19: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 19

Page Authoring in AEM 6.0

Page 20: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 20

Customer Page = ContentFrame

Editing Features = EditorFrame

Page 21: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

:

21

Sidepanel

AssetGroups

Page 22: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 22

Components

Page 23: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 23

These are Editables

Page 24: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 24

What is an Editable?

- is an instance of a component on a page

- allows access to the page’s HTML

- is aware of its JCR path and edit configuration

- the JCR node lives under the page’s “jcr:content”

- represented through a Javascript object

Page 25: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 25

An Editable in Javascript

- All Editable’s of the current page are accessible

through Granite.author.store

- Constructor: Granite.author.Editable

- It is a central object for manipulation and retrieval

- Allows to add listeners (afterEdit, beforeDelete, beforeMove etc).

- Exposes the configuration of the component

Page 26: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 26

These are Overlays

Page 27: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 27

Toolbar

Page 28: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 28

Page 29: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 29

Page 30: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 30

Inplace Editing

Page 31: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 31

Layer

Page 32: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 32

What is a layer?

- Bundles View/Rendering and Functionality

- Only 1 Layer is active

- Build-in layers: Edit, Preview, Annotate, Developer,

Target

- Have to play nicely with each other

- Defines a state of the Authoring User Interface

- Full control about the whole experience

Page 33: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 33

Layer Switcher

Page 34: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

- Toolbar action

- Inplace Editor

- Custom Layer

- Page action

Extending the Page Authoring

- Assetfinder Group

- Dialog Conversion

Page 35: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 35

Before we start…

- Javascript Namespace: Granite.author

- Overlays are managed by Granite.author.overlayManager

- ClientLib category hook: cq.authoring.editor.hook

- Current page’s Editables are in Granite.author.store

- A lot of page data is in Granite.author.page

Page 36: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 36

Custom toolbar action1

Page 37: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Still working: Adding custom actions to components

37

1

Page 38: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 38

- Javascript implementation

- toolbar entry definition

- component independent actions

1 Add Toolbar Button

Page 39: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 39

'CUSTOM': {

icon: 'coral-Icon--gear',

text: Granite.I18n.get('Custom'),

handler: function (editable, param, target) {

alert('my custom action');

// do not close toolbar

return false;

},

condition: function (editable) {

// optional condition to show action

return !!editable.config.orderable;

}

}

1

Page 40: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 40

EXAMPLE: Adding a screenshot functionality1

Page 41: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Custom page action

41

2

Page 42: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 42

2

/apps/wcm/core/content/editor/jcr:content/content/items/conte

nt/header/items/headerbar/items/myCustomButton

Page 43: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 43

Inplace Editors3

Page 44: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 46

Create a Hybrid Editor3

Page 45: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 47

var textImageEditorConfig = {

editors: [

{

editorType: "text",

imageClass: "coral-Icon coral-Icon--text"

},

{

editorType: "image",

imageClass: "coral-Icon coral-Icon--image"

}

]

};

textImageEditor =

new Granite.editor.HybridEditor(textImageEditorConfig);

// register the editor to the editor registry

Granite.author.editor.register('textimage', textImageEditor);

3

Page 46: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 48

Creating a layer

- Important objects: layerManager, overlayManager,

persistence

- Inherit from Build-in layers like Edit

- Change the view and actions

4

Page 47: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 50

Page 48: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

- Adding a new asset group

51

Assetfinder

- Handling the Drag&Drop

Granite.author.dropController

- Handling the Persistence

Granite.author.edit.actions or

Granite.author.persistence

- Handling the rendering

Granite.author.ui.assetFinder

5

Page 49: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 52

Dialog Conversion

- Console to convert Classic UI dialogs into Touch UI dialogsHelps to create the structure

ExtJS code needs to be migrated separately

- Plugin-basedContent nodes patterns

Implement OSGi service

6

Page 50: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 53

Extend

Admin screens

Create

Admin screens

Page

Authoring

Wrap-up

Page 51: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 54

Resources

- CRXDE Lite overlay extension tool on Package Share

- Official documentation: http://adobe.ly/1meXUn7

Customizing consoles and page authoring

- Examples on Github: http://github.com/Adobe-Marketing-Cloud

- CQGems recording: http://adobe.ly/1mwhsZZ

Page 52: UI Customization in AEM 6.0

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 56

Please give us feedback: http://adobe.ly/1pCZJ4h

Questions & Comments?


Top Related