APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER Hypermedia API Tools for Sling (HApi) Andrei Dulvac, Adobe

Similar documents
Modern Web Applications with Sightly

Extensible Components with Sling Models and HTL

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER Sling Rookie Session. Sebastian Schlick, pro!vision GmbH

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER Dynamic Components using SPA Concepts Andon Sikavica, Bojana Popovska

Rapid JCR applications development with Apache Sling

Making Sling Grunt Or How to Integrate Modern Front-End Development with Sling. Philip Hornig (Publicis Pixelpark), Michael Sunaric (Netcentric)

Rapid JCR applications development with Apache Sling

Migrating a large AEM project to Touch UI

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER APACHE JACKRABBIT: BASIC CONCEPTS Christian Riemath, Igor Sechyn

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER Rookie Session: JCR & Sling Andres Pegam, Stefan Seifert pro!

Microdata and schema.org

Scala for Sling. Building RESTful Web Applications with Scala for Sling. LOGO SPEAKER S COMPANY

First Simple Interactive JSP example

This project will use an API from to retrieve a list of movie posters to display on screen.

Getting Started with

Optimizing OAK repository search

Dingle Coderdojo 6. Project Part 2 (of 2) - Movie Poster And Actor! - Lookup. Week 6

wcm.io Context-Aware Configuration

Project Part 2 (of 2) - Movie Poster And Actor! - Lookup

User manual Scilab Cloud API

Junit 5 and Sling/AEM Mocks

The Web Browser Personalization with the Client Side Triplestore. Canon Inc., W3C/MIT: Hitoshi Uchida

Service Integration - A Web of Things Perspective W3C Workshop on Data and Services Integration

CS4HS Using Google App Engine. Michael Parker

Working Bootstrap Contact form with PHP and AJAX

Interactive Knowledge Stack A Software Architecture for Semantic Content Management Systems

Bootstrapping website development with Sling Models and HTL using Core Components Vlad Băilescu*, Burkhard Pauli, Richard Hand, Radu Cotescu

REST: I don't Think it Means What You Think it Does. Stefan

Jquery Ajax Json Php Mysql Data Entry Example

Child Items. Adding Child Items to plugin control panels. File Structure 4. Hacking childitems.html 7. Hacking childitem.html (without the s) 14

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment.

The State of Apache Sling

Web Software Model CS 4640 Programming Languages for Web Applications

(HTML Hypermedia APIs and Adaptive Web Design) Gustaf Nilsson Kotte

AIM. 10 September

Microdata and schema.org

LINKING WEB DATA WEB:

SA-REST: Using Semantics to Empower RESTful Services and Smashups with Better Interoperability and Mediation

Building Interoperable Metadata

The Web Browser Personalization with the Client Side Triplestore

AngularJS Introduction

AngularJS. Beginner's guide - part 1

APACHE SLING & FRIENDS TECH MEETUP SEPTEMBER Integrating a Modern Frontend Setup with AEM Natalia Venditto, Netcentric

INTRODUCTION TO WEB DEVELOPMENT IN C++ WITH WT 4

Summit Meeting Search meets Terminology. Felix Sasaki, DFKI / W3C Fellow, Berlin Christian Lieske, SAP, St. Leon-Rot

Adobe Experience Manager

Web Development and HTML. Shan-Hung Wu CS, NTHU

FatModel Quick Start Guide

welcome to BOILERCAMP HOW TO WEB DEV

August 2012 Daejeon, South Korea

BUILDING EXPERIENCE MANAGER COMPONENTS USING GRANITE/CORAL RESOURCE TYPES

Self-Study Exercise 2.4: Annotating Page Elements With Microdata. Objectives

Apache Wicket. Java Web Application Framework

Mobile Design for the Future That is Here Already. Rick Ells UW Information Technology University of Washington

Static Webpage Development

Web-APIs. Examples Consumer Technology Cross-Domain communication Provider Technology

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

Advantages: simple, quick to get started, perfect for simple forms, don t need to know how form model objects work

Bootstrap-Flask Documentation

Developing Ajax Applications using EWD and Python. Tutorial: Part 2

From HyperTEXT to HyperTEC

Web Focused Programming With PHP

Web Scraping with Python

Django Forme Documentation

Spring Data JPA, Spring Boot, Oracle, AngulerJS 적용게시판실습 게시판리스트보기.

C25: Creating Web Services using the Spring Framework

A. Add a property called debugclientlibs to the js.txt and set the value to true.

Introduction to web development with PHP

Delphi MVC Framework. Mathias Pannier

User manual Scilab Cloud API

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

Angular 2 and Hexo. Static Meets Dynamic For the Best of Both Worlds! Copyright 2016 Code Career Academy

HyperText Markup Language (HTML)

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

Flask-Cors Documentation

Homework 4: Comparing Search Engine Ranking Algorithms

CS2021-Week 9 - Forms. HTML Forms. Python Web Development. h?ps:// cs253/unit-2html. Form for Submitting input:

A Sample Approach to your Project

THE HITCHHIKERS GUIDE TO. Harper Maddox CTO, EdgeTheory 30 September 2014

A WEB APPLICATION FOR ONLINE POLLING. A Thesis. Presented to the. Faculty of. San Diego State University. In Partial Fulfillment

MIME Is a Terrible Thing to Waste: A Programmer s Guide

Lecture 8. ReactJS 1 / 24

Development of Web Applications

REST AND AJAX. Introduction. Module 13

About Sven. Using Groovy & Grails since Aug 2006 Grails Podcast, Groovy Series Working at Yahoo!, Inc. Find out yourself

Form Processing in PHP

PrintShop Mail Web. Web Integration Guide

Advantage of JSP over Servlet

CPET 581 E-Commerce & Business Technologies. Topics

Elementary! Incorporating BlueMix, Node-RED and Watson in Domino applications

Web technologies. Web. basic components. embellishments in browser. DOM (document object model)

SocialMiner Configuration

NXOS in the Real World Using NX-API REST

OSGi. Tales from the Trenches. OSGitales from the trenches

Learning Resource Metadata on the Web. Phil Barker & Lorna Campbell

ProductCamp: Product Schema, SEO, Structured Data Caliber Media Group & Schema.org. Products Product Schema SEO

Paythru Remote Fields

Jquery Manually Set Checkbox Checked Or Not

APACHE SLING & FRIENDS TECH MEETUP BERLIN, SEPTEMBER How to write clean & testable code without losing your mind - Andreas Czakaj

Application Express Listener Developer Guide

Transcription:

APACHE SLING & FRIENDS TECH MEETUP BERLIN, 28-30 SEPTEMBER 2015 Hypermedia API Tools for Sling (HApi) Andrei Dulvac, Adobe

ToC HatEoAS, Hypermedia formats, and semantic data Hypermedia API tools (HApi) overview Publick example Demo Q & (hopefully) A adaptto() 2015 2

HatEoAS, Hypermedia formats, and semantic data - quick overview adaptto() 2015 3

HatEoAS Hypermedia as the Engine of Application State Constraint of REST Use hypermedia controls to drive the app adaptto() 2015 4

Hypermedia API API machine-parsable formal description. Hypermedia Drive the application with hypermedia controls. HTML can work if we add semantic extensions adaptto() 2015 6

Semantic HTML HTML has semantics built-in; we need extensions Microformats RDFa Microdata Other adaptto() 2015 7

HApi overview adaptto() 2015 8

What is HApi (1/2) Hypermedia API tools for Apache Sling Annotates HTML with domain-specific semantics Custom Types in the Sling repository Works with Sightly and JSP adaptto() 2015 9

What is HApi (2/2) Outputs semantic extensions into the markup Current implementation for attributes Microdata Can be swapped w\o changing the server-side code Type-inference for properties Validation of properties adaptto() 2015 10

What is it good for? Creating a REST API Make existing markup machine-parsable Easy tests for Sling web apps minimum dependencies on the client-side Resilient to code changes (prop validation at script compile) Other advantages that formats like JSON have Avoiding code duplication Don t need a servlet for HTML and one for everything else adaptto() 2015 11

Components of HApi HApiUtil OSGi service Parameterized with a type from the repository gethelper() provides an AttributeHelper Current implementation - Microdata AttributeHelper output HTML attributes for Elements describing an object Elements describing properties of an object HApiUse Sightly Use object adaptto() 2015 12

Example Publick app overview adaptto() 2015 13

Example Publick the semantic types https://github.com/dulvac/publick-sling-blog adaptto() 2015 14

The HApi types (1/4) jcr_root/libs/publick/types/blog_post.json { "jcr:primarytype": "nt:unstructured,"description": "A blog post", "fqdn": "org.apache.sling.publick.blog_post", "name": "blog_post, "parameters": [], "sling:resourcetype": "sling/hapi/components/type", "title": { "jcr:primarytype": "nt:unstructured", "description": "The title of the blog post", "type": "org.apache.sling.hapi.common.text", "multiple": false }, adaptto() 2015 15

The HApi types (2/4) "label": { }, "jcr:primarytype": "nt:unstructured", "description": "A label or keyword for the blog post", "type": "org.apache.sling.hapi.common.text", "multiple": true "comment": { "jcr:primarytype": "nt:unstructured", } "description": "A comment for this blog post", "type": "/libs/publick/types/comment", "multiple": true adaptto() 2015 16

The HApi types (3/4) jcr_root/libs/publick/types/comment.json "jcr:primarytype": "nt:unstructured,"description": "A comment ", "fqdn": "org.apache.sling.publick.comment", "name": "comment, "parameters": [], "sling:resourcetype": "sling/hapi/components/type", "author": { }, time_created : {}, comment_text : {}, adaptto() 2015 17

The HApi types (4/4) "reply": { "jcr:primarytype": "nt:unstructured", "description": "A comment that is a reply for this comment", "type": "/libs/publick/types/comment, "multiple": true } adaptto() 2015 18

Example Publick The markup adaptto() 2015 19

Annotating the markup (1/2) blogview.html <div data-sly-use.hblog="${'org.apache.sling.hapi.hapiuse' @type='/libs/publick/types/blog_post'} data-sly-attribute="${hblog.itemtype} > <h1 data-sly-attribute="${hblog.itemprop.title}">${blog.title}</h1> <span data-sly-attribute="${hblog.itemprop.month_created} > </span> adaptto() 2015 20

Annotating the markup (2/2) Comments section <ul data-sly-list.comment="${comments.comments}"> <li data-sly-attribute="${hblog.itemprop.comment} data-sly-use.hcomment= "${'o.a.s.h.hapiuse' @type=hblog.proptype.comment} <span data-sly-attribute="${hcomment.itemprop.time_created} > <div data-sly-repeat.reply="${comment.replies} data-sly-attribute="${hcomment.itemprop.reply} data-sly-use.hreply= ${'o.a.s.h.hapiuse @type=hcomment.proptype.reply} > <span data-sly-attribute="${hcomment.itemprop.author} > </span> adaptto() 2015 21

Rendered markup HTML w/ microdata Comments section <ul> <li itemprop="comment itemscope itemtype=http://localhost:8080/libs/publick/types/comment.html> <span itemprop="time_created" itemscope itemtype= [ ]/text.html >July 4</span> <div itemprop="reply" itemscope itemtype=http://localhost:8080/libs/publick/types/comment.html> <span itemprop="author" itemscope itemtype= [ ]/text.html >Fido</span> adaptto() 2015 22

Demo adaptto() 2015 23

Appendix adaptto() 2015 24

Hypermedia controls The comments <form> <form data-rel="addcomment" method="post" action="/bin/publick/addcomment"> <label>name</label> <input type="text" name="author" class="form-control"> <label>comment</label> <textarea class="form-control" name="comment"></textarea> <button type="submit" class="btn btn-primary">post</button> </form> adaptto() 2015 25

Project location and code samples HApi tools https://github.com/apache/sling/tree/trunk/contrib/extensions/ha pi Publick blog engine fork https://github.com/dulvac/publick-sling-blog Python html demo client for microdata https://github.com/dulvac/htmlapi-client-python adaptto() 2015 26