using lazybones and editable template in aem projects...• is merged with the initial content...

16
Using Lazybones and Editable template in AEM projects Scott Macdonald| Ankur Ahlawat

Upload: others

Post on 06-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

Using Lazybones and Editable template in AEM projectsScott Macdonald| Ankur Ahlawat

Page 2: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Agenda

• Lazybones Overview

• Creating a Lazybones Project

• Basic Lazybones Command

• Eclipse and Lazybones

• Editable Templates

• Working with Editable Templates

• Demo

• Q&A

Page 3: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Lazybones Overview

“.• Lazybones is a command line tool which allows you to create a new project structure for any framework or library for which the tool has a template.

• Git Hub Repository for AEM Multi Module Template: https://github.com/Adobe-Consulting-Services/lazybones-aem-templates.

• Bintray Repository Path:https://bintray.com/repo/browse/pledbrook/lazybones-templates.

LazyBones Maven Archetype

Flexible Rigid

Easy integration with ACS Commons

No OOB integration with ACS Commons

No sample content Contains sample content (test, launcher)

Page 4: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Basic Lazybones commands

4

Pre requisite:-

• Maven version 3.0 or above is installed and configured• Lazybones is installed and its bin folder path is mapped to path

environment variable.• Java 7 and above is installed.

Basic Lazybones command

• lazybones create <template name> <template version> <template directory>

• lazybones list• lazybones info <template name>• lazybones config <list>

Page 5: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Creating AEM Project using Lazybones

5

Page 6: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Eclipse and Lazybones

6

Pre requisite :–

• Maven is installed and configured.• Valid AEM jar and license file.

Getting started with Project :–

• Import as maven Project in Eclipse

• Create AEM server

• Deploy AEM project to CRXDE.

Page 7: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

DEMO – Build a Lazybone project

Page 8: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Editable Templates

• Editable Templates can be used as a container for Experience Manager components.

• You can specify which Experience Manager Components are allowed in a template.

• Allow Experience Manager authors to create and edit templates using a user interface.

• Provide templates that retain a dynamic connection to any pages created from them; this ensures that any changes to the template are reflected in the pages themselves.

• Make the page component more generic so the foundation page component can be used without customization.

• You can define the layout of a template. For example, you can define a two column layout for the template which results in a page having a two layout column.

.

Page 9: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Start of an Editable Template

9

Page 10: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

An Example Editable Template

Page 11: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Template Definitions

Definitions for editable templates are stored in folders, either global or user defined; for example:

• /conf/global/settings/wcm/templates• /conf/<my-folder>/settings/wcm/templates• /conf/<my-folder-01>/<my-folder-02>/settings/wcm/templates.Lets take a look at a real example:

Page 12: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Template Definitions

The main elements are:

• <template-name>• initial• jcr:content• structure• policies• thumbnail.png

Jcr:contentThis node holds properties for the template:

• Name: jcr:title• Name: status (String) - draft, enabled or disabled

Page 13: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Template Definitions

StructureDefines the structure of the resultant page:

• Is merged with the initial content (/initial) when creating a new page.• Changes made to the structure will be reflected in any pages created with the template.• The root (structure/jcr:content/root) node defines the list of components that will be available in the

resulting page.• Components defined in the template structure cannot be moved/deleted from any resultant pages.• Once a component is unlocked the editable property is set to true.• Once a component that already contains content is unlocked, this content will be moved to the initial

branch• The cq:responsive node holds definitions for the responsive layouting.

Page 14: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

Template Definitions

Initial ContentDefines the structure of the resultant page:

• Defines the initial content that a new page will have upon creation:

• Contains a jcr:content node that is copied to any new pages.• Is merged with the structure (/structure) when creating a new page.• Any existing pages will not be updated if the initial content is changed after creation.• The root node holds a list of components to define what will be available in the resulting page.• If content is/has been added to a component in structure mode and that component is subsequently

unlocked (or vice versa), then this content is used as initial content.

Page 15: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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

DEMO – Lets Build an Editable Template

Page 16: Using Lazybones and Editable template in AEM projects...• Is merged with the initial content (/initial) when creating a new page. • Changes made to the structure will be reflected

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