Version 6 of Adobe Experience Manager (AEM 6) is a major release that introduces significant innovations. Sightly is a new template system to be used in place of (or together with) JSP. Along with Sling Models, SIghtly strongly improves the separation between the logic and presentation. The development effort is reduced because a Sightly template is an HTML 5 document, easily maintainable even by front-end developers.
The presentation provides an overview of the basic features of Sightly and introduces the fundamentals of the new development model with the support of tools released release together with AEM 6.
RichText Editor (RTE) is an integral component of AEM and it provides AEM authors a WYSIWYG text-editing experience on the web pages. RTE offers diverse configurations to developers.
This presentation provides an in-depth understanding of this component and shows various concepts, use-cases, modes, configurations, best practices, limitations and troubleshooting that surround it.
E-Seminar recording published here -
https://helpx.adobe.com/experience-manager/kt/eseminars/gems/AEM-Rich-Text-Editor-RTE-Deep-Dive1.html
This document provides an overview of key features in Sightly, an HTML templating language used in Adobe Experience Manager (AEM):
- It describes Sightly statements like data-sly-use, data-sly-attribute, data-sly-element, and data-sly-resource that allow manipulating elements, attributes, and including resources.
- Expression options like @context, @format, @join, and @i18n that control output are also covered.
- URI manipulation using options like @scheme, @domain, @path, @query, and @fragment is explained.
- Other topics include template and call statements, external templates, and the
A presentation given at the adaptTo() 2014 tech meetup on the topic of developing dynamic AEM components using concepts borrowed from the SPA philosophy.
Components for AEM Sites that cover the most common web content needs.
Discover which components exist, what features they offer, how they work technically and how they can be extended by a developer.
Sling Models Using Sightly and JSP by Deepak Khetawat
This document discusses using Sling Models with Sightly and JSP templates in AEM. It provides an overview of Sling Models, including their purpose, design goals, and key annotations. It also describes the standard injectors available in Sling Models and how to create custom injectors. The document outlines how to add Sling Model dependencies and use Sling Models within JSP and Sightly templates, including code examples. It concludes with a demonstration of Sling Models in action and information for appendix materials and questions.
This document discusses single page applications (SPAs) and their relationship with content management systems (CMS) like Adobe Experience Manager (AEM). It provides background on the shift from traditional websites to SPAs, outlines benefits and challenges of SPAs for both IT and marketing teams, and describes how AEM 6.4 aims to support content delivery to various channels including SPAs through a decoupled architecture.
OSGI is a Java framework that implements a dynamic component model. It allows modular Java applications to be built from separate bundles that can be loaded, started, stopped and updated independently. Key aspects include:
- Bundles are JAR files with additional configuration that can be loaded and stopped independently without affecting other bundles.
- Services allow bundles to publish and discover capabilities via a registry. Dependencies between bundles are resolved dynamically.
- The OSGi framework provides a lifecycle to manage the loading, starting and stopping of bundles.
- Annotations like @Component, @Service and @Reference allow defining OSGi components and services using declarative services.
- The OSGi specification is implemented by frameworks like
This document discusses Sling Models in AEM, including what they are, why they are useful, how to use them, and examples of Sling Model annotations. Sling Models allow mapping of Sling objects like resources and requests to plain Java objects using annotations. They reduce coding efforts and make code more maintainable by avoiding redundant code. The document covers the necessary dependencies, common annotations like @Model, @Inject, @Optional, and examples of injecting resources, child resources, and retrieving values from the request.
This document discusses integration patterns in Adobe Experience Manager (AEM), including using Sling Models for dependency injection and accessing resources from different locations through a single ResourceResolver. It provides examples of integrating with backend APIs, databases, file systems and forms using techniques like ResourceProviders, Sling Filters and custom SlingServlets. It also covers accessing files from bundles and the filesystem using BundleResourceProvider and FsResourceProvider respectively.
The document provides tips and best practices for configuring multiple farms in AEM Dispatcher. Key points include:
- Splitting the Dispatcher configuration into multiple farms based on different caching needs, such as separate farms for DAM assets and pages.
- Configuring different caching parameters and cache folders for each farm to optimize caching behavior.
- Handling cache invalidation requests and vanity URLs across multiple farms.
- Different approaches for flushing caches from Author and multiple Publishers to Dispatchers, and avoiding race conditions.
- Bypassing the Dispatcher cache for select clients by rewriting URLs to include parameters checked by the Dispatcher configuration.
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
This document summarizes a presentation on developing dynamic components in AEM using single-page application concepts. It discusses how traditional approaches to dynamic components can be tricky when components need to communicate and update frequently. An SPA approach treats each component as a module that handles its own data fetching and updating independently via AJAX calls. On page load, the server returns only static markup and components get dynamic data by making POST requests to a controller returning JSON. This allows for perceived faster interactions and easier front-end/back-end separation compared to full page reloads. Examples demonstrate rendering templates, initialization scripts, and a sample controller class to retrieve and return dynamic component data.
The document outlines the six key steps to create a solid AEM architecture:
1. Get the overall picture right by defining where AEM fits within the broader solution and how it will integrate with other systems. AEM can serve as an umbrella system, provider system, or independent system.
2. Map features to AEM's capabilities and validate choices through proofs of concept if using additional products. Consider licensing.
3. Design a simple, flexible content structure that supports features like multilingual and allows for future growth.
4. Plan the integration approach, aiming to integrate as close to the browser as possible when exposing services from AEM.
5. Determine the deployment model in advance as it impacts design choices
This was presented at Adobe's 'Ask the AEM Expert' Session. This session covered
Introduction to the core components
How to use and when to use the core components
Introduction to AEM-eCommerce Integration and implementation of custom AEM native commerce,. This also gives introduction to multiple AEM commerce components and Commerce APIs.
Visit http://adobeaemclub.com to know more about it. Also you can follow our Github to get examples
https://github.com/AEMClub/adobe-aem-club/tree/master/commerceexample
AEM (CQ) Dispatcher Security and CDN+Browser Caching
This presentation cover Adobe AEM Dispatcher security and CDN and browser caching.
This presentation is the second part of a webinar on AEM Dispatcher:
http://dev.day.com/content/ddc/en/gems/dispatcher-caching---new-features-and-optimizations.html
Visit url above to view the whole presentation. Domique Pfister the primary engineer developing AEM Dispatcher covers the first part on new features.
Chetan Mehrotra, Senior Computer Scientist, and Alex Parvulescu, Senior Developer, Adobe presented on Jan 20, 2016. They describe the features of Oak Lucene indexes and how they can be used to get your queries perform better. In the second part we will talk about how asynchronous indexing works in general and how it can be monitored.To view the on-demand session go to: http://bit.ly/AEMGems1202016 or for the MP4 version http://bit.ly/AEMGemsMP41202016
The document discusses LinkedIn's adoption of the Dust templating language in 2011. Some key points:
- LinkedIn needed a unified view layer as different teams were using different templating technologies like JSP, GSP, ERB.
- They evaluated 26 templating options and selected Dust as it best met their criteria like performance, i18n support, and being logic-less.
- Dust templates are compiled to JavaScript for client-side rendering and to Java for server-side rendering (SSR) through Google's V8 engine, allowing templates to work on both client and server.
- SSR addresses challenges like SEO, supporting clients without JavaScript, and i18n by rendering
The document outlines an agenda for a session on HTML, CSS, and UI/UX design. It includes a quick revision of HTML and CSS standards and practices. It introduces HTML5 best practices regarding semantic elements. It defines what UI/UX is and why it is important. It discusses some UI principles to follow, such as keeping designs simple, straightforward, and focused on context while guiding users and providing feedback.
This document provides an overview of an upcoming training on Oracle Universal Content Management (UCM) 11g and Site Studio. It introduces the instructor, Lee Klement, and outlines the agenda for the three day training, which will cover topics such as deploying dynamic web sites, Site Studio administration, creating custom elements, using Idoc script, adding navigation, and more. Optional additional lessons may include creating fragments, working more with Idoc script, and Site Studio services.
Add-On Development: EE Expects that Every Developer will do his Duty
Add-Ons are what make ExpressionEngine the flexible powerhouse that it is today. Being able to write your own simple plugins or incredibly expansive modules allows you to mold ExpressionEngine to nearly any task that your website might require. However, with that power comes a great responsibility to insure that your code is not slowing down the entire site or unduly stressing the server through bad code architecture.
There are simple tools already built into ExpressionEngine and PHP that you can use to see precisely what your Add-On is doing during page processing and where it might be doing more work than is absolutely necessary. Every developer should use these to optimize their work from the very beginning of development, prior to release. This workshop will explain these tools and how you can use them effectively. It will also delve deeper into optimization techniques and tricks that will keep your code light and clean, while finding a balance between functionality and performance.
This document summarizes a talk on add-on development for ExpressionEngine. It discusses the three types of add-ons in EE - extensions, modules, and plugins. It covers important skills for add-on development like PHP, SQL, HTML/CSS, and JavaScript. It provides guidance on developing add-ons including researching existing approaches, mapping out features, designing database structures and template tags, and building the control panel. The document emphasizes best practices like following EllisLab development guidelines, proper commenting, sanitizing inputs, and using abstraction.
Introduction
Require JS
Handlebars
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
AngularJS 1.x - your first application (problems and solutions)
We will talk about all aspects of building a single page application with AngularJS, and we will discuss real examples from day-to-day work. We will also cover a large amount of theory about general web development, best practices, and today's client demands. We will focus on three (3) main points: architecture, security, and real time notification.
This document discusses how Sightly and Slice can work together in AEM projects. Sightly provides a clear presentation layer for markup, while Slice leverages the Guice dependency injection framework. Models built with Slice can be used directly in Sightly templates via the data-sly-use attribute. This allows fine-grained control over objects while keeping Sightly templates clean. The key benefit of Slice is the standardized Guice dependency injection approach it provides.
This document discusses add-on development for ExpressionEngine. It covers what add-ons are, including extensions, modules, and plugins. It discusses necessary development skills like PHP, SQL, and HTML/CSS. It provides guidance on planning add-on development through researching, mapping features, designing templates and control panels. The document also covers writing code through following best practices, debugging, and improving performance. Developers are encouraged to turn on debugging, review queries, consider caching, remove deprecated code, and ask for help when needed.
Add-On Development: EE Expects that Every Developer will do his Duty
A presentation on Add-On Development: EE Expects that Every Developer will do his Duty as given at the EECI2009 conference in Leiden by Paul Burdick, lead developer at Solspace.
Introduction
Require JS
Handlebars
Conclusions
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2015.
http://www.ivanomalavolta.com
Improving the Quality of Existing Software - DevIntersection April 2016
How do you improve the quality of your existing software, while continuing to add value for your customers? What are some heuristics and code smells you can look for, and principles and patterns you can use to guide you, as you make your software better over time instead of worse? How can we improve our skills and techniques so that writing high quality software becomes our default, fastest way of working?
Sling is a RESTful web application framework that uses JCR repositories like Apache Jackrabbit as its data store. Sling maps HTTP requests to content resources in the repository and uses the resource type to locate the appropriate rendering script. The request URL is decomposed into the resource path, selectors, extension, and suffix path. Sling searches for a node matching the resource path and then locates a script based on the resource type and any selectors. Sling scripts cannot be called directly and must be resolved through the resource to follow REST principles. This document discusses how Sling maps URLs to content resources and scripts to process requests.
SPA Editor - Adobe Experience Manager SitesGabriel Walt
The Single Page Application (SPA) Editor of Adobe Experience Manager (AEM) Sites allows in-context authoring (wysiwyg editing) of content that is delivered headless as JSON and rendered in the browser with JavaScript frameworks like React or Angular. AEM provides a JS SDK that is lightweight and that allows the JS components to be built in ways that can be entirely agnostic from AEM: the front-end developers need only minimal AEM knowledge and can work independently from AEM.
RichText Editor (RTE) is an integral component of AEM and it provides AEM authors a WYSIWYG text-editing experience on the web pages. RTE offers diverse configurations to developers.
This presentation provides an in-depth understanding of this component and shows various concepts, use-cases, modes, configurations, best practices, limitations and troubleshooting that surround it.
E-Seminar recording published here -
https://helpx.adobe.com/experience-manager/kt/eseminars/gems/AEM-Rich-Text-Editor-RTE-Deep-Dive1.html
This document provides an overview of key features in Sightly, an HTML templating language used in Adobe Experience Manager (AEM):
- It describes Sightly statements like data-sly-use, data-sly-attribute, data-sly-element, and data-sly-resource that allow manipulating elements, attributes, and including resources.
- Expression options like @context, @format, @join, and @i18n that control output are also covered.
- URI manipulation using options like @scheme, @domain, @path, @query, and @fragment is explained.
- Other topics include template and call statements, external templates, and the
A presentation given at the adaptTo() 2014 tech meetup on the topic of developing dynamic AEM components using concepts borrowed from the SPA philosophy.
Adobe Experience Manager Core ComponentsGabriel Walt
Components for AEM Sites that cover the most common web content needs.
Discover which components exist, what features they offer, how they work technically and how they can be extended by a developer.
Sling Models Using Sightly and JSP by Deepak KhetawatAEM HUB
This document discusses using Sling Models with Sightly and JSP templates in AEM. It provides an overview of Sling Models, including their purpose, design goals, and key annotations. It also describes the standard injectors available in Sling Models and how to create custom injectors. The document outlines how to add Sling Model dependencies and use Sling Models within JSP and Sightly templates, including code examples. It concludes with a demonstration of Sling Models in action and information for appendix materials and questions.
This document discusses single page applications (SPAs) and their relationship with content management systems (CMS) like Adobe Experience Manager (AEM). It provides background on the shift from traditional websites to SPAs, outlines benefits and challenges of SPAs for both IT and marketing teams, and describes how AEM 6.4 aims to support content delivery to various channels including SPAs through a decoupled architecture.
OSGI is a Java framework that implements a dynamic component model. It allows modular Java applications to be built from separate bundles that can be loaded, started, stopped and updated independently. Key aspects include:
- Bundles are JAR files with additional configuration that can be loaded and stopped independently without affecting other bundles.
- Services allow bundles to publish and discover capabilities via a registry. Dependencies between bundles are resolved dynamically.
- The OSGi framework provides a lifecycle to manage the loading, starting and stopping of bundles.
- Annotations like @Component, @Service and @Reference allow defining OSGi components and services using declarative services.
- The OSGi specification is implemented by frameworks like
This document discusses Sling Models in AEM, including what they are, why they are useful, how to use them, and examples of Sling Model annotations. Sling Models allow mapping of Sling objects like resources and requests to plain Java objects using annotations. They reduce coding efforts and make code more maintainable by avoiding redundant code. The document covers the necessary dependencies, common annotations like @Model, @Inject, @Optional, and examples of injecting resources, child resources, and retrieving values from the request.
This document discusses integration patterns in Adobe Experience Manager (AEM), including using Sling Models for dependency injection and accessing resources from different locations through a single ResourceResolver. It provides examples of integrating with backend APIs, databases, file systems and forms using techniques like ResourceProviders, Sling Filters and custom SlingServlets. It also covers accessing files from bundles and the filesystem using BundleResourceProvider and FsResourceProvider respectively.
The document provides tips and best practices for configuring multiple farms in AEM Dispatcher. Key points include:
- Splitting the Dispatcher configuration into multiple farms based on different caching needs, such as separate farms for DAM assets and pages.
- Configuring different caching parameters and cache folders for each farm to optimize caching behavior.
- Handling cache invalidation requests and vanity URLs across multiple farms.
- Different approaches for flushing caches from Author and multiple Publishers to Dispatchers, and avoiding race conditions.
- Bypassing the Dispatcher cache for select clients by rewriting URLs to include parameters checked by the Dispatcher configuration.
Dynamic Components using Single-Page-Application Concepts in AEM/CQNetcetera
This document summarizes a presentation on developing dynamic components in AEM using single-page application concepts. It discusses how traditional approaches to dynamic components can be tricky when components need to communicate and update frequently. An SPA approach treats each component as a module that handles its own data fetching and updating independently via AJAX calls. On page load, the server returns only static markup and components get dynamic data by making POST requests to a controller returning JSON. This allows for perceived faster interactions and easier front-end/back-end separation compared to full page reloads. Examples demonstrate rendering templates, initialization scripts, and a sample controller class to retrieve and return dynamic component data.
The document outlines the six key steps to create a solid AEM architecture:
1. Get the overall picture right by defining where AEM fits within the broader solution and how it will integrate with other systems. AEM can serve as an umbrella system, provider system, or independent system.
2. Map features to AEM's capabilities and validate choices through proofs of concept if using additional products. Consider licensing.
3. Design a simple, flexible content structure that supports features like multilingual and allows for future growth.
4. Plan the integration approach, aiming to integrate as close to the browser as possible when exposing services from AEM.
5. Determine the deployment model in advance as it impacts design choices
This was presented at Adobe's 'Ask the AEM Expert' Session. This session covered
Introduction to the core components
How to use and when to use the core components
Introduction to AEM-eCommerce Integration and implementation of custom AEM native commerce,. This also gives introduction to multiple AEM commerce components and Commerce APIs.
Visit http://adobeaemclub.com to know more about it. Also you can follow our Github to get examples
https://github.com/AEMClub/adobe-aem-club/tree/master/commerceexample
AEM (CQ) Dispatcher Security and CDN+Browser CachingAndrew Khoury
This presentation cover Adobe AEM Dispatcher security and CDN and browser caching.
This presentation is the second part of a webinar on AEM Dispatcher:
http://dev.day.com/content/ddc/en/gems/dispatcher-caching---new-features-and-optimizations.html
Visit url above to view the whole presentation. Domique Pfister the primary engineer developing AEM Dispatcher covers the first part on new features.
Chetan Mehrotra, Senior Computer Scientist, and Alex Parvulescu, Senior Developer, Adobe presented on Jan 20, 2016. They describe the features of Oak Lucene indexes and how they can be used to get your queries perform better. In the second part we will talk about how asynchronous indexing works in general and how it can be monitored.To view the on-demand session go to: http://bit.ly/AEMGems1202016 or for the MP4 version http://bit.ly/AEMGemsMP41202016
The document discusses LinkedIn's adoption of the Dust templating language in 2011. Some key points:
- LinkedIn needed a unified view layer as different teams were using different templating technologies like JSP, GSP, ERB.
- They evaluated 26 templating options and selected Dust as it best met their criteria like performance, i18n support, and being logic-less.
- Dust templates are compiled to JavaScript for client-side rendering and to Java for server-side rendering (SSR) through Google's V8 engine, allowing templates to work on both client and server.
- SSR addresses challenges like SEO, supporting clients without JavaScript, and i18n by rendering
The document outlines an agenda for a session on HTML, CSS, and UI/UX design. It includes a quick revision of HTML and CSS standards and practices. It introduces HTML5 best practices regarding semantic elements. It defines what UI/UX is and why it is important. It discusses some UI principles to follow, such as keeping designs simple, straightforward, and focused on context while guiding users and providing feedback.
Advanced Site Studio Class, June 18, 2012Lee Klement
This document provides an overview of an upcoming training on Oracle Universal Content Management (UCM) 11g and Site Studio. It introduces the instructor, Lee Klement, and outlines the agenda for the three day training, which will cover topics such as deploying dynamic web sites, Site Studio administration, creating custom elements, using Idoc script, adding navigation, and more. Optional additional lessons may include creating fragments, working more with Idoc script, and Site Studio services.
Add-On Development: EE Expects that Every Developer will do his Dutyreedmaniac
Add-Ons are what make ExpressionEngine the flexible powerhouse that it is today. Being able to write your own simple plugins or incredibly expansive modules allows you to mold ExpressionEngine to nearly any task that your website might require. However, with that power comes a great responsibility to insure that your code is not slowing down the entire site or unduly stressing the server through bad code architecture.
There are simple tools already built into ExpressionEngine and PHP that you can use to see precisely what your Add-On is doing during page processing and where it might be doing more work than is absolutely necessary. Every developer should use these to optimize their work from the very beginning of development, prior to release. This workshop will explain these tools and how you can use them effectively. It will also delve deeper into optimization techniques and tricks that will keep your code light and clean, while finding a balance between functionality and performance.
This document summarizes a talk on add-on development for ExpressionEngine. It discusses the three types of add-ons in EE - extensions, modules, and plugins. It covers important skills for add-on development like PHP, SQL, HTML/CSS, and JavaScript. It provides guidance on developing add-ons including researching existing approaches, mapping out features, designing database structures and template tags, and building the control panel. The document emphasizes best practices like following EllisLab development guidelines, proper commenting, sanitizing inputs, and using abstraction.
Introduction
Require JS
Handlebars
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
We will talk about all aspects of building a single page application with AngularJS, and we will discuss real examples from day-to-day work. We will also cover a large amount of theory about general web development, best practices, and today's client demands. We will focus on three (3) main points: architecture, security, and real time notification.
When Sightly Meets Slice by Tomasz NiedźwiedźAEM HUB
This document discusses how Sightly and Slice can work together in AEM projects. Sightly provides a clear presentation layer for markup, while Slice leverages the Guice dependency injection framework. Models built with Slice can be used directly in Sightly templates via the data-sly-use attribute. This allows fine-grained control over objects while keeping Sightly templates clean. The key benefit of Slice is the standardized Guice dependency injection approach it provides.
This document discusses add-on development for ExpressionEngine. It covers what add-ons are, including extensions, modules, and plugins. It discusses necessary development skills like PHP, SQL, and HTML/CSS. It provides guidance on planning add-on development through researching, mapping features, designing templates and control panels. The document also covers writing code through following best practices, debugging, and improving performance. Developers are encouraged to turn on debugging, review queries, consider caching, remove deprecated code, and ask for help when needed.
Add-On Development: EE Expects that Every Developer will do his DutyLeslie Doherty
A presentation on Add-On Development: EE Expects that Every Developer will do his Duty as given at the EECI2009 conference in Leiden by Paul Burdick, lead developer at Solspace.
Introduction
Require JS
Handlebars
Conclusions
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2015.
http://www.ivanomalavolta.com
Improving the Quality of Existing Software - DevIntersection April 2016Steven Smith
How do you improve the quality of your existing software, while continuing to add value for your customers? What are some heuristics and code smells you can look for, and principles and patterns you can use to guide you, as you make your software better over time instead of worse? How can we improve our skills and techniques so that writing high quality software becomes our default, fastest way of working?
Improving the Quality of Existing SoftwareSteven Smith
The document discusses techniques for improving the quality of existing software, including reducing technical debt, following principles like DRY and SOLID, using characterization tests to preserve behavior during refactoring, and improving skills to write higher quality code faster. It covers topics like refactoring, test-driven development, dependency inversion, and design patterns. The goal is to maintain and enhance application code quality over time through refactoring and preventing technical debt.
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannNCCOMMS
1. ARM templates allow defining infrastructure as code and deploying Azure resources in a consistent, repeatable manner.
2. Parameters, outputs, functions, and linked/nested templates provide flexibility in ARM templates.
3. ARM templates can be implemented in CI/CD pipelines to automate deployments to different environments.
Session 34 - JDBC Best Practices, Introduction to Design PatternsPawanMM
In this session, you will learn:
1. Deployment Descriptor
2. Configuring and Mapping a Servlet
3. The flow of the demo web apps
4. JDBC Best practices
5. Design Patterns
This is a presentation that was presented at Tech Next meetup group (http://www.meetup.com/TechNext/events/168164922/), to introduce the audience to AngularJs (http://angularjs.org/).
It covers major ideas that AngularJS thrives on - data-binding, directives, services, dependency-injections, form validations, overall application architecture, Angular's view of MVC etc.
The content was prepared with the recent experience I gained which working for a short stint on a project earlier and is as per best of my knowledge.
This document provides an overview of using Node.js with the MySQL Document Store. It discusses how MySQL can be used as a NoSQL database with the new MySQL Document Store API. Key components that enable this include the X DevAPI, Router, X Plugin, and X Protocol. The API allows for schemaless data storage and retrieval using JSON documents stored in MySQL collections. Documents can be added, retrieved, modified, and removed from collections using the MySQL Connector/Node.js driver.
The document discusses using Oracle TopLink as a persistence framework with EJB 3.0 and Java Persistence API (JPA). It provides an overview of persistence frameworks and their benefits, and outlines goals to develop an understanding of J2EE design, persistence frameworks, and how to develop a simple persistence framework using TopLink. The presentation also demonstrates creating Java entity objects from database tables using TopLink wizards in JDeveloper, and building a session bean to expose the entities and provide data access functionality.
Improving the Quality of Existing SoftwareSteven Smith
How do you improve the quality of your existing software, while continuing to add value for your customers? What are some heuristics and code smells you can look for, and principles and patterns you can use to guide you, as you make your software better over time instead of worse?
Similar to Introduction to Sightly and Sling Models (20)
A captivating AI chatbot PowerPoint presentation is made with a striking backdrop in order to attract a wider audience. Select this template featuring several AI chatbot visuals to boost audience engagement and spontaneity. With the aid of this multi-colored template, you may make a compelling presentation and get extra bonuses. To easily elucidate your ideas, choose a typeface with vibrant colors. You can include your data regarding utilizing the chatbot methodology to the remaining half of the template.
COMPSAC 2024 D&I Panel: Charting a Course for Equity: Strategies for Overcomi...Hironori Washizaki
Hironori Washizaki, "Charting a Course for Equity: Strategies for Overcoming Challenges and Promoting Inclusion in the Metaverse", IEEE COMPSAC 2024 D&I Panel, 2024.
React Native vs Flutter - SSTech SystemSSTech System
Your project needs and long-term objectives will ultimately choose which of React Native and Flutter to use. For applications using JavaScript and current web technologies in particular, React Native is a mature and trustworthy choice. For projects that value performance and customizability across many platforms, Flutter, on the other hand, provides outstanding performance and a unified UI development experience.
NBFC Software: Optimize Your Non-Banking Financial CompanyNBFC Softwares
NBFC Software: Optimize Your Non-Banking Financial Company
Enhance Your Financial Services with Comprehensive NBFC Software
NBFC software provides a complete solution for non-banking financial companies, streamlining banking and accounting functions to reduce operational costs. Our software is designed to meet the diverse needs of NBFCs, including investment banks, insurance companies, and hedge funds.
Key Features of NBFC Software:
Centralized Database: Facilitates inter-branch collaboration and smooth operations with a unified platform.
Automation: Simplifies loan lifecycle management and account maintenance, ensuring efficient delivery of financial services.
Customization: Highly customizable to fit specific business needs, offering flexibility in managing various loan types such as home loans, mortgage loans, personal loans, and more.
Security: Ensures safe and secure handling of financial transactions and sensitive data.
User-Friendly Interface: Designed to be intuitive and easy to use, reducing the learning curve for employees.
Cost-Effective: Reduces the need for additional manpower by automating tasks, making it a budget-friendly solution. Benefits of NBFC Software:
Go Paperless: Transition to a fully digital operation, eliminating offline work.
Transparency: Enables managers and executives to monitor various points of the banking process easily.
Defaulter Tracking: Helps track loan defaulters, maintaining a healthy loan management system.
Increased Accessibility: Cutting-edge technology increases the accessibility and usability of NBFC operations. Request a Demo Now!
React and Next.js are complementary tools in web development. React, a JavaScript library, specializes in building user interfaces with its component-based architecture and efficient state management. Next.js extends React by providing server-side rendering, routing, and other utilities, making it ideal for building SEO-friendly, high-performance web applications.
Explore the rapid development journey of TryBoxLang, completed in just 48 hours. This session delves into the innovative process behind creating TryBoxLang, a platform designed to showcase the capabilities of BoxLang by Ortus Solutions. Discover the challenges, strategies, and outcomes of this accelerated development effort, highlighting how TryBoxLang provides a practical introduction to BoxLang's features and benefits.
Are you wondering how to migrate to the Cloud? At the ITB session, we addressed the challenge of managing multiple ColdFusion licenses and AWS EC2 instances. Discover how you can consolidate with just one EC2 instance capable of running over 50 apps using CommandBox ColdFusion. This solution supports both ColdFusion flavors and includes cb-websites, a GoLang binary for managing CommandBox websites.
What is OCR Technology and How to Extract Text from Any Image for FreeTwisterTools
Discover the fascinating world of Optical Character Recognition (OCR) technology with our comprehensive presentation. Learn how OCR converts various types of documents, such as scanned paper documents, PDFs, or images captured by a digital camera, into editable and searchable data. Dive into the history, modern applications, and future trends of OCR technology. Get step-by-step instructions on how to extract text from any image online for free using a simple tool, along with best practices for OCR image preparation. Ideal for professionals, students, and tech enthusiasts looking to harness the power of OCR.
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdfTrackobit
What do fleet managers do? What are their duties, responsibilities, and challenges? And what makes a fleet manager effective and successful? This blog answers all these questions.
A Comparative Analysis of Functional and Non-Functional Testing.pdfkalichargn70th171
A robust software testing strategy encompassing functional and non-functional testing is fundamental for development teams. These twin pillars are essential for ensuring the success of your applications. But why are they so critical?
Functional testing rigorously examines the application's processes against predefined requirements, ensuring they align seamlessly. Conversely, non-functional testing evaluates performance and reliability under load, enhancing the end-user experience.
2. 2
• What is Sightly?
• Why Sightly?
• Separation of concerns
• Comparing JSP and Sightly development
• Sightly features
• Sightly: the basics of the language
• Not a silver bullet
• Sightly and Sling Models
• An amazing combination
• Basic usage
• Learning from experience
• wcm-io and ACS Commons libraries
• Useful links
• A few hands-on examples
Summary
3. 3
• New secure server-side HTML Templating Language introduced with AEM6 for
efficient development
• “Sightly” (meaning “pleasing to the eye”)
• “Alternative” to JSP
• Specification and TCK open sourced to GitHub
• Reference Adobe implementation donated to Apache Sling by Adobe (September
2014)
• Sightly reference implementation has been folded into Apache Sling project
• org.apache.sling.scripting.sightly
• org.apache.sling.xss
What is Sightly
6. 6
The standard workflow:
• Front end developers create HTML mark up, designs with all necessary client side
libraries
• (AEM) back end developers take this well formed, high-fidelity static HTML
“prototype”
• Systematically split the whole template in pieces
• Put it together again as JSP templates and components
• Add custom business logic inside JSP templates and components
This leads to well known issues:
• The process of splitting and putting together is error prone
• The process itself is time consuming
• This way of development does not provide good (and simple) separation of concerns
between UI and business logic
• As front end developers can’t easily maintain JSPs, they don’t develop new
components “inside” AEM
• They don’t directly cope with components issues in Author mode
(both visualization and UI issues)
Why Sightly: separation of concerns
13. 13
Why Sightly: comparing JSP and Sightly
• Writing custom tag lib is not easy
• Need to mantain both Java class and TLD
• Custom tag lib lifecycle is hard to understand and difficult to integrate
inside the templates
• Have you ever effectively used it for your projects?
JSP Sightly
Based on Published Standards / Open Source?Y (*) N Y
IDE Support? Y Y/N
Officially Documented / Supported? Y Y
Documented Extension Model? Y N
Includes XSS escaping? Y (**) Y
Allows Basic Logic? Y Y
Enables Bad Coding Practices? Y N
* Some proprietary TagLibs used for interacting with CQ
** Provided by additional tag libraries
14. 14
Why Sightly: features
• Code-less language, forcing strict separation of concerns
• Powerful extension points with the Use-API
• Automatic contextual HTML escaping and XSS protection
• Automatically removes HTML attributes if value is empty
• Reuses HTML blocks for statements
15. 15
Sightly: the basics of the language
Expression language example:
<a href=‘‘{properties.link || ‘#’}’’ title=‘‘{properties.jcr:title}’’>
${properties.jcr:description}
</a>
Features:
- Automatic contextual HTML escaping and XSS escaping (warning!)
- Fallback value if property is empty
- Remove HTML attribute if value is empty
16. 16
Sightly: the basics of the language
• Sightly comments
<!-- /* This will disappear from the output *-->
• Expression language
${properties.myProperty}
• They can only be used in attribute values, comments or in element content
• Standard bindings are available as in JSPs
• Block statements
<div data-sly-include=‘‘another-template.html’’></div>
17. 17
Sightly: the basics of the language
• Expression bindings:
• ${properties}
• ${pageProperties}
• ${inheritedPageProperties}
• ${request} Sling Request
• ${resource} Sling Resource
• ${currentPage} WCM Page
• ${currentDesign} WCM Design
• ${component} WCM Component
• ${wcmmode} WCM Mode
Access properties with dot
notation ${properties.foo}
To avoid complex expressions inside
templates, Sightly does not allow
passing arguments to function call.
Only zero argument calls are allowed
from templates.
18. 18
Sightly: the basics of the language
• Options allow to manipulate the result of an expression, or to pass
arguments to block statements
• Everything after the @ are comma separated options:
${myVar @ optionOne, optionTwo}
• Examples:
• String formatting:
${‘Page {0} of {1}’ @ format=[current, total]}
• Internationalization:
${‘Page’ @ i18n}
• Array join:
${[‘one’, ‘two’] @ join=‘; ’}
19. 19
Sightly: the basics of the language
• Display context
• Every expression in Sightly has a display context
• Display context depends on the location within the HTML structure
• Example: text node, attribute, …
• Sightly automatically detect the context of expressions and escape them appropriately (to
prevent XSS)
This is not true for script (JS) and style (CSS) contexts
In this case we should explicitly set the context
• Example
<a href="${properties.link}" title="${properties.title}">${properties.text}</a>
Three variables, three different contexts.
No explicit context setting is required in the above cases
20. 20
Sightly: the basics of the language
• Display context option
• The context option offers control over escaping and XSS protection
• Explicit context must be set for style contexts:
<span style="color: ${properties.color @
context='styleToken'};">...</span>
• To safely output markup (filtering out scripts)
<div>${properties.richText @ context=‘html’}</div>
uses AntiSamy policy rules
The default antisamy configuration is present at /libs/cq/xssprotection/config.xml, which can
be overlaid with your custom config within /apps.
• Adding URI validation protection to other attributes than src or href
<p data-link=‘‘${link @ context=‘uri’}’’>text</p>
21. 21
Sightly: the basics of the language
• Most useful contexts and what they do:
• uri To display links and paths (validates URI)
• attribute Encodes HTML special characters
• text Encodes HTML special characters
• scriptString Encodes characters that would break out the string
• styleString Validates CSS tokens. Outputs nothing if it fails
• html Filters HTML to meet AntiSamy policy rules, removing what doesn’t match
• unsafe Disable all escaping and XSS protections
22. 22
Sightly: the basics of the language
• Block statements
• To keep markup valid, block statements are defined by data-sly-* attributes
that can be added to any element on the markup
• <input data-sly-STATEMENT=‘‘foo’’ />
• Block statements can have no value, a static value, or an expression
<input data-sly-STATEMENT=‘‘${bar}’’ />
• Despite using data-attributes, block statements are all executed on the
server and no data-sly-* attribute is sent to the client!
• Sightly block statements:
• Markup inclusion: Include, Resource
• Control flow: test, list, template, call
• Markup modification: unwrap, element, attribute, text
• Object initialization: use
23. 23
Sightly: the basics of the language
• Template and call statements
• Similar to data-sly-include
• Main difference: you can pass parameters to the included template
• Templates must be declared and called from another template
• <data-sly-template> declares a template
<template data-sly-template.header> <div> my template </div> </template>
Defines a template called header
Notice: the host element are not output by Sightly. If you call this template the only printed
mark up will be
<div> my template </div>
• <div data-sly-call=‘‘header’’></div> calls the template header defined above
• Templates can be located in a different file
• Templates accept parameters
<template data-sly-template.two=‘‘${ @ title}’’> <h1>${title}</h1> </template>
<div data-sly-call=‘‘${two @ title=properties.jcr:title}’’></div>
24. 24
Sightly: the basics of the language
• Unwrap statement
• Removes the host element while retaining its content
<div data-sly-unwrap> <h1> Title </h1> </div>
Output: <h1> Title </h1>
• Warning!
• Use unwrap only when there’s no other way to write your template
• Prefer adding statements to existing elements
• Templates can easily become difficult to read
• Unwrap can also be subject to condition
<div class=‘‘edit-md’’ data-sly-unwrap=‘‘${wcmmode.edit}’’>
Text
</div>
Output: Text in EDIT mode
Output in PREVIEW/PUBLISH mode: <div class=‘‘edit-md’’>
Text
</div>
• Use data-sly-test to remove the element content as well
25. 25
Sightly: the basics of the language
• Use statement: Sightly Javascript Use API. Enables a Sightly file to access
helper code written in Javascript.
• Initialize a helper objects
<div data-sly-use.logic=‘‘logic.js’’>${logic.value}</div>
Inside logic.js file
use(function()) {
return {
value: ‘‘Hello World’’
};
});
Output:
<div> Hello World </div>
• Use Javascript Use API only for very simple tasks (date formatting, text
formatting, simple conditional logic, …):
• Javascript Use API is server-side Javascript (some JS native features are not fully supported)
• Cannot be debugged
• Very hard to find errors
• It’s slow
• Very hard to write Javascript Use API code for more complex task (e.g., cycling on repository
nodes, calling external services, etc.)
26. 26
Sightly: the basics of the language
• Use statement: Sightly Java Use API enables a Sightly file to access helper
methods in a custom Java class.
• POJO extending WCMUse class
• WCMUse has been deprecated from AEM 6.1
and replaced with WCMUsePojo which uses
the new Sightly API from Apache Sling
• Local Java class: when the Java files are located in the content repository,
next to the Sightly template, only the class name is required to call the logic
• Bundle Java class: the Java class must be compiled and deployed within
an OSGi bundle (recommended when Java code implements logic
common to many components)
27. 27
Sightly: the basics of the language
• Many ways to do the same thing. But, what kind of Use-API is better?
• Model logic:
This logic is not tied to a template and is potentially reusable among
components. It should aim to form a stable API that changes little, even in
case of a full redesign. ➔ Java located in OSGi bundle
Example: Java class retrieving information from a web service; Java class
implementing logic for computing the menu structure
• View logic:
This logic is specific to the templates and is likely to change if the design
changes. It is thus a good practice to locate it in the content repository, next
to the template.
➔ JavaScript located in component if components are to be maintained by front-end devs (typically
with Brackets).
➔ Java located in component if performance is critical (e.g. when many requests are not cached by
the dispatcher).
Example: code implementing logic to output certain css classes inside the
template mark up (e.g., list menu, with selected/non selected items)
28. 28
Not a silver bullet
• Sightly is a good option to improve the maintanability of your AEM
components but…
• You should follow best practices and guidelines otherwise your template code can
explode easily
• data-sly-unwrap can be evil
• wrap author/preview version of HTML inside smaller templates to be included; this makes your
components easier to read
• avoid use context=‘‘unsafe’’
• It is not extensible with new block statements or options
• Can be hard to debug
• <img data-sly-use.logic=‘‘foo.test.SomeLogic’’ data-sly-test=‘‘${logic.value}’’ >
• if the test is false, everything below img tag won’t be output; this can be hard to debug
• always use self closed elements
• Can lead to many Use API files containing the same logic
• Before implementing a new one, think about a common class extending WCMUse or Sling Model
• Can be frustrating, sometimes
• Write Use API external code even for the easy tasks
• Follow a style guide: https://github.com/Netcentric/aem-sightly-style-guide
29. 29
Sightly and Sling Models: an amazing combination
• Sling Models are POJOs implementing the adapter pattern. They can be
automatically mapped from Sling objects
• Resource
• SlingHttpRequest
• Entirely annotation driven
• OOTB, support resource properties (implemented with ValueMap), SlingBindings,
OSGi services, request attributes
• Current latest version: 1.2.0
• AEM6+SP2 comes with 1.0.0
• Versions > 1.0.0 contain very useful features:
• 1.0.6: injector-specific annotations
• 1.1.0: @Self, @SlingObject, @ResourcePath annotations
• 1.2.0: Sling validation
30. 30
Sightly and Sling Models: basic usage
package com.foo.core;
@Model(adaptables=Resource.class)
public class MyModel {
@Inject private String propertyName;
public String getResult() {
return ‘‘Hello World ’’ + propertyName;
}
}
• Class is annotated with @Model
• adaptbles option defines which types of objects are adaptable to this Sling Model
• Fields that need to be injected are annotated
In this case, propertyName is a property coming from the adapted resource
• Constructor injection (since 1.1.0)
@Model(adaptables=Resource.class)
public class MyModel {
@Inject
public MyModel(@Named("propertyName") String propertyName) {
// constructor code
}
}
31. 31
Sightly and Sling Models: basic usage
@Injected fields/methods are assumed to be required. To mark them as optional,
use @Optional:
@Model(adaptables=Resource.class)
public class MyModel {
@Inject @Optional
private String otherName;
}
A default value can be provided (for Strings & primitives):
@Model(adaptables=Resource.class)
public class MyModel {
@Inject @Default(values="defaultValue")
private String name;
}
32. 32
Sightly and Sling Models: basic usage
OSGi services can be injected:
@Model(adaptables=Resource.class)
public class MyModel {
@Inject
private ResourceResolverFactory resourceResolverFactory;
}
List injection for child resources works by injecting grand child resources (since
Sling Models Impl 1.0.6). For example, the class
@Model(adaptables=Resource.class)
public class MyModel {
@Inject
private List<Resource> addresses;
}
addresses will contain address1 and address2
33. 33
Sightly and Sling Models: basic usage
The @PostConstruct annotation can be used to add methods which are invoked upon
completion of all injections:
@Model(adaptables=SlingHttpServletRequest.class)
public class MyModel {
@Inject
private PrintWriter out;
@Inject
@Named("log")
private Logger logger;
@PostConstruct
protected void sayHello() {
logger.info("hello");
}
}
34. 34
Sightly and Sling Models: basic usage
Available injectors:
https://sling.apache.org/documentation/bundles/models.html#available-injectors
35. 35
Sightly and Sling Models: basic usage
Injector-specific annotation vs normal annotations
Those annotations replace @Via, @Filter, @Named, @Optional, @Required, @Source and
@Inject. @Default may still be used in addition to the injector-specific annotation to set
default values. All elements given above are optional.
Annotation
Supported Optional
Elements
Injector
@ScriptVariable optional and name script-bindings
@ValueMapValue optional, name and via valuemap
@ChildResource optional, name and via child-resources
@RequestAttribute optional, name and via request-attributes
@ResourcePath optional, path, and name resource-path
@OSGiService optional, filter osgi-services
@Self optional self
@SlingObject optional sling-object
36. 36
Sightly and Sling Models: client code
From a Sightly template:
<div data-sly-use.model=‘‘com.foo.core.MyModel’’>${model.result}</div>
From Java code:
MyModel model = resource.adaptTo(MyModel.class)
37. 37
Sightly and Sling Models: learning from experience
• Sling Models are instantiated everytime they are used with data-sly-use or adaptTo.
Issues can happen when the Sling Model instantiation includes connection to DB or web
service calls. Best practice: put Sling Model instance inside request object (in case the
same model is used within the same request).
• They can be hard to debug sometimes…
Since Sling Models 1.2.0 there is another way of instantiating models. The OSGi service
ModelFactory provides a method for instantiating a model that throws exceptions. This is
not allowed by the Javadoc contract of the adaptTo method. That way null checks are not
necessary and it is easier to see why instantiation of the model failed.
• Why Sling Models and NOT WCMUse
Sling Models are based on the adapter pattern
Dependency injection
Less simpler code
It’s a POJPO unit testable
38. 38
Sightly and Sling Models: ACS AEM commons and wcm.io
https://adobe-consulting-services.github.io/acs-aem-commons/features/aem-sling-models-
injectors.html
Allows for Sling Models classes and interfaces to be injected with common AEM-related
objects, namely those made available using <cq:defineObjects/>: resource,
resourceResolver, componentContext, pageManager, etc.
@Inject
private Page resourcePage;
http://wcm.io/sling/models/
Support injection request-derived context objects on all models, not only when the adaptable
is a request
The name “Sightly” (meaning “pleasing to the eye”) highlights its focus on keeping your markup beautiful, and thus maintainable, once made dynamic.
This way of development does not provide good (and simple) separation of concerns between UI and business logic: in realtà I modi ci sarebbero: CUSTOM TAG LIBRARIES
Il tempo per lo sviluppo dei component con l’utilizzo di JSP + logica Java all’interno è maggiore
AUTOMATIC CONTEXTUAL HTML ESCAPING AND XSS PROTECTION:
Sightly automatically filters and escapes all variables being output to the presentation layer to prevent cross-site-scripting (XSS) vulnerabilities.
As Sightly understands the HTML syntax, it is capable to automatically detect the scope in which variables are placed, and automatically do proper context-aware escaping and XSS protection. Yet, it is possible to manually control the display context if needed.
REUSES HTML BLOCKS FOR STATEMENTS:
Sightly block statements are custom data attributes added directly to existing HTML. This allows easy and unobtrusive annotation of a prototype static HTML page, converting it to a functioning dynamic template without breaking the validity of the HTML code.
The display context of a Sightly expression refers to its location within the structure of the HTML page. For example, if the expression appears in place that would produce a text node once rendered, then it is said to be in a text context. If it is found within the value of an attribute, then it is said to be in an attribute context, and so forth.
With the exception of script (JS) and style (CSS) contexts, Sightly will automatically detect the context of expressions and escape them appropriately, to prevent XSS security problems. In the case of scripts and CSS, the desired context behavior must be explicitly set. Additionally, the context behavior can also be explicitly set in any other case where an override of the automatic behavior is desired.
Here we have three variables in three different contexts: properties.link (uri context), properties.title (attribute context) and properties.text (text context). Sightly will escape each of these differently in accordance with the security requirements of their respective contexts. No explicit context setting is required in normal cases such as this one:
<a href="${properties.link}" title="${properties.title}">${properties.text}</a>
The display context of a Sightly expression refers to its location within the structure of the HTML page. For example, if the expression appears in place that would produce a text node once rendered, then it is said to be in a text context. If it is found within the value of an attribute, then it is said to be in an attribute context, and so forth.
With the exception of script (JS) and style (CSS) contexts, Sightly will automatically detect the context of expressions and escape them appropriately, to prevent XSS security problems. In the case of scripts and CSS, the desired context behavior must be explicitly set. Additionally, the context behavior can also be explicitly set in any other case where an override of the automatic behavior is desired.
Here we have three variables in three different contexts: properties.link (uri context), properties.title (attribute context) and properties.text (text context). Sightly will escape each of these differently in accordance with the security requirements of their respective contexts. No explicit context setting is required in normal cases such as this one:
<a href="${properties.link}" title="${properties.title}">${properties.text}</a>
Less code to write (only one annotation is necessary in most of the cases)
More robust (in case of name collisions among the different injectors, you make sure that the right injector is used)
Better IDE support (because the annotations provide elements for each configuration which is available for that specific injector, i.e. filter only for OSGi services)
Why Sling Models and NOT WCMUse: https://www.cognifide.com/blogs/cq/sightly-and-slice---where-a-beautiful-markup-meets-a-beautiful-code/#.VgK7-d_tmko
Why Sling Models and NOT WCMUse: https://www.cognifide.com/blogs/cq/sightly-and-slice---where-a-beautiful-markup-meets-a-beautiful-code/#.VgK7-d_tmko