Sightly Component Development



Similar documents
Drupal CMS for marketing sites

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Cross Site Scripting (XSS) and PHP Security. Anthony Ferrara NYPHP and OWASP Security Series June 30, 2011

Model-View-Controller. and. Struts 2

AEM Developer Tools for Eclipse

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Web Frameworks and WebWork

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

YouTrack MPS case study

IBM Script Portlet for WebSphere Portal Release 1.1

CLASSROOM WEB DESIGNING COURSE

Progressive Enhancement With GQuery and GWT. Ray Cromwell

The Learn-Verified Full Stack Web Development Program

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Creating a REST API for Cloud services using Apache Felix and Sling Carsten Ziegeler and David Bosschaert

<Insert Picture Here> Michael Hichwa VP Database Development Tools Stuttgart September 18, 2007 Hamburg September 20, 2007

WIRIS quizzes web services Getting started with PHP and Java

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

MODERN WEB APPLICATION DEVELOPMENT WORKFLOW

Web Application Development

NextRow - AEM Training Program Course Catalog

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER APACHE SLING & SCALA Jochen Fliedner

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Web Applications and Struts 2

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

What I Wish I Had Known. In my first 30 days with umbraco

Java Application Developer Certificate Program Competencies

Java with Eclipse: Setup & Getting Started

JBoss Portlet Container. User Guide. Release 2.0

Server-side OSGi with Apache Sling. Felix Meschberger Day Management AG 124

Web Programming Languages Overview

CrownPeak Java Web Hosting. Version 0.20

.NET Best Practices Part 1 Master Pages Setup. Version 2.0

Example. Represent this as XML

Modern Web Application Framework Python, SQL Alchemy, Jinja2 & Flask

Elgg 1.8 Social Networking

Web Development with the Eclipse Platform

Kentico Site Delivery Checklist v1.1

About ZPanel. About the framework. The purpose of this guide. Page 1. Author: Bobby Allen Version: 1.1

MASTER DRUPAL 7 MODULE DEVELOPMENT

Unlocking the Java EE Platform with HTML 5

NewsletterAdmin 2.4 Setup Manual

Intro to Web Programming. using PHP, HTTP, CSS, and Javascript Layton Smith CSE 4000

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Business Application Development Platform

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Lucy Zhang UI Developer Contact:

Web Application diploma using.net Technology

Continuous Integration

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

Pentesting Web Frameworks (preview of next year's SEC642 update)

Drupal and ArcGIS Yes, it can be done. Frank McLean Developer

The Web as a Client-Server System; TCP/IP intro!

Developing ASP.NET MVC 4 Web Applications MOC 20486

SOFTWARE TESTING TRAINING COURSES CONTENTS

JSP Java Server Pages

GLOBAL CONSULTING SERVICES TOOLS FOR WEBMETHODS Software AG. All rights reserved. For internal use only

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

10CS73:Web Programming

Meister Going Beyond Maven

Creating a folder in a library and submitting a form

Documentation and Project Organization

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

Preface. Motivation for this Book

What s really under the hood? How I learned to stop worrying and love Magento

Web Developer Toolkit for IBM Digital Experience

How To Customize A Forum On Vanilla Forum On A Pcode (Forum) On A Windows (For Forum) On An Html5 (Forums) On Pcode Or Windows 7 (Forforums) On Your Pc

JavaScript Programming

Pro/INTRALINK Curriculum Guide

Mobile Application Development

JavaScript Client Guide

Alfresco. Wiley Publishing, Inc. PROFESSIONAL. PRACTICAL SOLUTIONS FOR ENTERPRISE. John Newton CONTENT MANAGEMENT. Michael Farman Michael G.

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

Struts Tools Tutorial. Version: M5

CQCON 2013: five Sling features you should know

Team Members: Christopher Copper Philip Eittreim Jeremiah Jekich Andrew Reisdorph. Client: Brian Krzys

AJAX Toolkit Framework

Web Designing with UI Designing

The NetBeans TM Ruby IDE: You Thought Rails Development Was Fun Before

Modern Web Development From Angle Brackets to Web Sockets

Magento Extension Developer s Guide

Interactive Data Visualization for the Web Scott Murray

Sabre Red Apps. Developer Toolkit Overview. October 2014

Developing ASP.NET MVC 4 Web Applications

The truth about Drupal

Modern Web Development:

Short notes on webpage programming languages

GLEN RIDGE PUBLIC SCHOOLS MATHEMATICS MISSION STATEMENT AND GOALS

Building Rich Internet Applications with PHP and Zend Framework

Software documentation systems

Web Application Guidelines

Braindumps.C questions

How To Write An Ria Application

Web Development with Flask and the Raspberry Pi Leading by Example CUAUHTEMOC CARBAJAL ITESM CEM 22/04/2014

Transcription:

Sightly Component Development @GabrielWalt, Product Manager @RaduCotescu, Product Developer

Development Workflow Design HTML/CSS Web Developer HTML CSS/JS Inefficiency Static HTML being handed over Component Java Developer Java/OSGi Business Logic Business logic

Development Workflow Design HTML/CSS Web Developer HTML CSS/JS Component Efficient APIs to OSGi bundles Business Logic Java Developer Java/OSGi Business logic

Development Workflow Can be edited by Web Developer: Component JSP (HTML markup & component logic) Client Libraries (CSS & JS)

Development Workflow Can be edited by Web Developer: HTML markup (Sightly template) Component logic (server-side JS) Component JSP (HTML markup & component logic) Client Libraries (CSS & JS)

Sightly Lightweight No dependencies, fast and lean Secure Automatic contextual XSS protection and URL externalization Code-less Enforce separation of concerns between logic and markup Powerful Straight-forward API for logic, allowing to do virtually anything Intuitive Clear, simple & restricted feature set

Sightly VS JSP Sightly <a href="${properties.link '#'}" title="${properties.jcr:title}"> ${properties.jcr:description} </a> JSP <a href="<%= xssapi.getvalidhref(properties.get("link", "#")) %>" <% String title = properties.get("jcr:title", ""); if (title.length() > 0) { %>title="<%= xssapi.encodeforhtmlattr(title) %>"<% } %>> <%= xssapi.encodeforhtml(properties.get("jcr:description", "")) %> </a>

Building Blocks Expression Language ${properties.myproperty} Block Statements <p data-sly-test="${isvisible}">${text}</p> Use-API <p data-sly-use.obj="script.js">${obj.text}</p>

Expressions Literals ${42} ${true} ${'Hello World'} ${[1, 2, 3]} Variables ${myvar} ${properties.propname} ${properties.jcr:title} ${properties['my property']} ${properties[myvar]}

Expression Operators Logical operations ${!myvar} ${conditionone conditiontwo} ${conditionone && conditiontwo} ${properties.jcr:title conditiontwo} Equality / Inequality (only for same types) ${varone == vartwo} ${varone!= vartwo} Comparison (only for integers) ${varone < vartwo} ${varone <= vartwo} ${varone > vartwo} ${varone >= vartwo}

Expression Operators Conditional ${mychoice? varone : vartwo} Grouping ${varone && (vartwo varthree)}

Expression Options Everything after the @ is an option ${myvar @ optone, opttwo} ${myvar @ optone='value', opttwo=[1, 2, 3]} Parametric expression, containing only options ${@ optone='value', opttwo=[1, 2, 3]}

Expression Options String formatting ${'Page {0} of {1}' @ format=[current, total]} Internationalization ${'Page' @ i18n} ${'Page' @ i18n, hint='translation Hint'} ${'Page' @ i18n, source='user'} ${'Page' @ i18n, locale='en-us'} Array Join ${['one', 'two'] @ join='; '}

Display Context Option Offers control over escaping and XSS protection Allowing some HTML markup (will apply XSSAPI.filterHTML) <div>${properties.jcr:description @ context='html'}</div> Adding URI XSS protection to other fields than src or href <p data-link="${link @ context='uri'}">text</p> In script or style contexts, the context option is mandatory <script>trackid="${id @ context='scriptstring'}";</script>

Use Statement Initializes a helper object <div data-sly-use.nav="navigation.js">${nav.foo}</div> Output <div>hello World</div>

Server-side JavaScript logic <!--/* template.html */--> <div data-sly-use.nav="navigation.js">${nav.foo}</div> <!--/* navigation.js */--> use(function () { return { foo: "Hello World" }; });

<!--/* template.html */--> Java logic <div data-sly-use.nav="navigation">${nav.foo}</div> <!--/* Navigation.java */--> package apps.site_name.component_name; import com.adobe.cq.sightly.wcmuse; public class Component extends WCMUse { private String foo; @Override public void activate() throws Exception { foo = "Hello World"; } public String getfoo() { } return foo; }

Server-side Java-Script VS Java Server-side JavaScript Can easily be edited by web developers Java Fast Easy to debug We are working on improving that for server-side JavaScript Can be located in the component folder, or in an OSGi bundle

Unwrap Statement Removes the host element while retaining its content <div data-sly-use.nav="navigation.js" data-sly-unwrap> ${nav.foo}</div> Output Hello World Use unwrap with care, the template should correspond as much as possible to the output.

Text, Attr & Elem Statements Replaces the content, attribute or element name <div class="active" title="lorem ipsum" data-sly-element="${elementname}" data-sly-attribute.title="${classname}" data-sly-text="${content}">lorem ipsum</div> Output <span class="active" title="hi!">hello World</span> Use element with care, it can make the template confusing when the element name gets changed.

Test Statement Conditionally removes the element and it's content <p data-sly-test="${properties.showtext}">text</p> <p data-sly-test.abc="${a b c}">is true</p> <p data-sly-test="${!abc}">or not</p> Output <p>text</p> <p>is true</p>

List Statement Repeats the content for each enumerable property <ol data-sly-list="${currentpage.listchildren}"> <li>${item.title}</li> </ol> Output <ol> <li>triangle Page</li> <li>square Page</li> </ol>

Resource Statement Includes the result of the indicated resource <article data-sly-resource="path/to/resource"></article> Output <article><!-- Result of the rendered resource --></article>

Resource Statement Options Manipulating selectors (selectors, addselectors, removeselectors) <article data-sly-resource="${'path/to/resource' @ selectors='mobile'}"></article> Overriding the resourcetype <article data-sly-resource="${'path/to/resource' @ resourcetype='my/resource/type'}"></article> Changing WCM mode <article data-sly-resource="${'path/to/resource' @ wcmmode='disabled'}"></article>

Include Statement Includes the rendering of the indicated template (Sightly, JSP, ESP, etc.) <section data-sly-include="path/to/template.html"></section> Output <section><!-- Result of the rendered resource --></section>

Template & Call Statement <!--/* template.html */--> <template data-sly-template.one="${@ class, text}"> <span class="${class}">${text}</span> </template> <!--/* other-file.html */--> <div data-sly-use.tmpl="template.html" data-sly-call="${tmpl.one @ class='example', text='hi!'}"></div> Output <div><span class="example">hi!</span></div>

Sightly FAQ Why didn t you choose an existing template language? We want it to be coding language agnostic (also client/server agnostic) We want it to have just the right feature set (with a strong focus on security) We want it to naturally lead developers towards best practice Do I need to migrate my components to Sightly? No, we want Sightly to help you to be more efficient on the new components you build, not loose time on migrating components that already work. Can I still use JSP, or will JSP get deprecated? Sightly and JSP can very well be mixed, even within the same component Today, we have no plan to deprecate JSP-based components

Development Workflow Two developer roles Component Web Developer Business Logic Java Developer

Development Workflow An IDE plugin for each developer role Brackets plugin! Sightly code completion & syntax highlighting Content nodes & properties manipulation Eclipse plugin! Content nodes & properties manipulation Bundle development & hot deployment

IDE Sync Work on file system + transparent sync & content editing Brackets / Eclipse IDE auto push hot deploy manual pull Content Repository IDE works on the File System Version Control System (Git / Svn) sync File System

Component Development Cost JSP Design HTML/CSS Template JSP Logic Java Project Management Sightly Design HTML/CSS Template Sightly HTML Logic Use-API Project Management ~25%

Resources Documentation http://dev.day.com/content/docs/en/aem/6-0/develop/sightly.html Java Docs http://docs.adobe.com/content/docs/en/aem/6-0/develop/ref/javadoc/index.html?com/adobe/ cq/sightly/wcmuse.html Experience Delivers blog posts (http://experiencedelivers.adobe.com/) Sightly intro part 1 Sightly intro part 2 Sightly intro part 3 Sightly intro part 4 Sightly intro part 5: FAQ