#SummitNow Alfresco 4.2 Share Development Workshop November 6, 2013 Kevin Dorr, Sr. Solutions Engineer, Alfresco US.

Slides:



Advertisements
Similar presentations
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
Advertisements

Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Dawn Pedersen Art Institute. What is Spry? Spry is Dreamweaver’s version of JavaScript libraries. Spry effects alter the look of a page element—or of.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Agenda What is BIRT? BIRT Features and Report Gallery Scripting BIRT
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
High Performance Faceted Interfaces Using S2S Eric Rozell, Tetherless World Constellation.
ICS 665 Jesse Abdul. jQuery UI Overview  jQuery UI javascript library Includes all UI component functionality  jQuery UI CSS framework Includes standard.
Intelligent Tutoring System Mobile Communication Team Drew Boatwright Nakul Dureja Richard Liou.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Website Development. W hat do you really want the website to say? How do you lay out the website and web pages? When it's completed, where do you publish?
JQuery CS 268. What is jQuery? From their web site:
© 2012 Boise State University1 WordPress Training February 14, 2013.
Christopher Paolini Computational Science Research Center College of Engineering San Diego State University Computational Science 670 Fall 2009 Monday.
© Blackboard, Inc. All rights reserved. My First Building Block as a Content Type Heather Natour Senior Lead Engineer Blackboard Inc. July 18 th 1:30pm.
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
Ajax Runtime Toolkits IBM Emerging Technologies. What is an AJAX Toolkit/Framework? An AJAX Toolkit/Runtime is more than just XMLHTTPRequest Should includes:
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
© 2012 Boise State University1 WordPress Training February 14, 2013.
Some essentials difference syntax and concept for jquery developers Roohullah Afzali
Creating Effective School and PTA Websites Sam Farnsworth Utah PTA Technology Specialist
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Struts2 Plugin Development - Extending Struts2 Justin Yip.
Chapter 13. Applets and HTML HTML Applets Computer Programming with JAVA.
JavaScript Framework for Rich Apps in Every Browser Maura Wilder Joan Wortman
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
© 2006 IBM Corporation JDojo & ScriptEngine Agile Planning’s Scripting Tools.
Peter Laird. | 1 Building Dynamic Google Gadgets in Java Peter Laird Managing Architect WebLogic Portal BEA Systems.
© 2006 IBM Corporation Agile Planning Web UI. © 2006 IBM Corporation Agenda  Overview of APT Web UI  Current Issues  Required Infrastructure  API.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Developing AJAX Web applications with Castle Monorail David De Florinier Gojko Adzic Skills Matter 12/06/08.
DotNetNuke Workshop Presented by: Sara Sharick. Topics What is DotNetNuke Components Requesting a DDN Site Creating Pages Modules Adding Content Document.
JavaScript Framework for Rich Apps in Every Browser Maura Wilder Joan Wortman
GALE: The GRAPPLE Adaptive Learning Environment Paul De Bra Eindhoven University of Technology January 24, 2011 GRAPPLE Public Event Slide 1.
Web Design I Spring 2009 Kevin Cole Gallaudet University
JDojo and Its Usage Te-Hsin Shih 04/30/2013. Dojo Dojo Toolkit is an open source JavaScript library designed to ease the rapid development of cross-platform,
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
How to Build an IT Portal with Oracle Application Server Allan L Haensgen Senior Principal Instructor Oracle Corporation Session id:
Unit 13 –JQuery Basics Instructor: Brent Presley.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Bundles, Minification Andres Käver, IT Kolledž
SHAREPOINT & JQUERY. Hi, my name and I am a product manager at lightning tools. I have been working with SharePoint for 5 years.
1.Getting Started 2.Modifying Design 3.Newsletter Templates 4.Announcement 5.Administer Sections Index Training 14 th Mar., 2011.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Dynamic UI Generation with Alfresco Share and Aikau
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
Share Enhancements David Webster. Introduction Me: David Webster Alfresco Engineer Joined April 2010 UI The Session: Share Enhancements:
#SummitNow The Share Widget Library 13 th November 2013 Dave Draper
AJAX. Objectives Understand and apply AJAX Using AJAX in DOJO library.
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
XML-RPC Web Services in WinCC OA An Application: online PARA JCOP FWWG Meeting Lorenzo Masetti.
The Share Widget Library
JavaScript: Good Practices
Getting Started with Alfresco Development
CARA 3.10 Major New Features
Google Web Toolkit Tutorial
Data Virtualization Tutorial… CORS and CIS
Getting started with Alfresco Development
Action Request System Example Education Console
One of a new Eclipse Photon feature
Consult America Technology Consulting Services
Web Programming and Design
Presentation transcript:

#SummitNow Alfresco 4.2 Share Development Workshop November 6, 2013 Kevin Dorr, Sr. Solutions Engineer, Alfresco US

#SummitNow Overview

#SummitNow Workshop Outline Development Tools Housekeeping Simple Project Definition Simple Page 10 Minutes on Dojo Simple Widget Big Finish

#SummitNow My Perspective

#SummitNow Audience Participation

#SummitNow Getting Started

#SummitNow What You Will Need… Java (JDK 1.7) Maven (3.1) Eclipse (Kepler) m2Eclipse Alfresco Source

#SummitNow Lay of the Land

#SummitNow Change is Good Dave Draper went over why yesterday There are a lot of benefits for both page and widget development It really is a LOT easier!

#SummitNow Where Things Are Source Code: root/projects/slingshot /source/web Widget library is in js/alfresco Also themes, etc. Warning!

#SummitNow Where Things Are Widget Code: templates i18n images other special Widget css js alfresco

#SummitNow Where Things Should Go For Production: Make an AMP File! Alfresco amps Repo amp share_amps Share amp

#SummitNow Where Things Should Go For Development (pages and widgets): tomcat shared lib jar

#SummitNow Where Things Should Go For Development (Pages): tomcat shared Site- webscripts classes alfresco Any Arbitrary Path Individual Code Files Web- extension

#SummitNow Where Things Should Go

#SummitNow Resources You Can Leverage

#SummitNow Resources You Can Leverage

#SummitNow Resources You Can Leverage Debug mode: tomcat/webapps/share/classes/alfresco/share-config.xml Tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml true

#SummitNow “Zero Build” widget resource list widget resource list widget resource list widget resource list JSON Page Definition “Built” Dojo Ipsum loren ipsum Ipsum loren Ipsum loren etc User page rendering CSS Image Dojo CSS Dojo Cached Resources CSS Image Dojo CSS Dojo CSS i18n Dojo CSS Server Page Resources Analyze Resolve and Generate Cache

#SummitNow See How Resources are Managed

#SummitNow Share Surf Servlet URIs Stand Alone Page Webscripts /share/page/dp/ws/{webscript URL} /share/page/site/{site}/dp/ws/{ws URL} Hybrid Pages (Share header and footer) /share/page/hdp/ws/{ws URL} Hybrid Remote Pages (from Repo) /share/page/site/{site}/p/{page name} /share/page/hrp/p/{page name}

#SummitNow A Simple Project

#SummitNow Project Concept Special Purpose UI for a Photo Intake Editor Doesn’t need or want to see the rest of Share Just needs to sort photos into keep, maybe, reject Has several “trays” of photos to sort through Has several projects simultaneously

#SummitNow UI Sketch Company Header “Slide Tray” Selection Area Tray Filters Photo Viewer Area

#SummitNow Page Construction

#SummitNow Share Page Example

#SummitNow Share Page Example Lightbox Widget Here Accordion Widget Here

#SummitNow Share Page Files page-name.get.desc.xml (Webscript Descriptor) page-name.get.js (WebScript Controller) page-name.get.html.ftl (Freemarker Template) page-name.get.properties(Optional Text Strings) Files need to be in the same directory Anywhere under site-webscripts is ok

#SummitNow Share Page Descriptor (desc.xml) Create page via JSON editor A page definition for creating pages using a JSON editor Share /page-editor

#SummitNow Share Page Template (.html.ftl)

#SummitNow Share Page Controller (.js) { "widgets": [ { "id": "SET_PAGE_TITLE", "name": "alfresco/header/SetTitle", "config": { "title": "Alfresco Summit Demo" } }, { "name": "alfresco/layout/AlfSideBarContainer", "config": { "initialSidebarWidth": "300" } ] }

#SummitNow Modifying the JSON { "name": "alfresco/layout/AlfSideBarContainer", "config": { "initialSidebarWidth": "300", "widgets": [{ "name": "alfresco/menus/AlfMenuBar", "align": "sidebar", "config": { "widgets": [ { "name": "alfresco/menus/AlfMenuBarItem", "config": { "label": "Filter" } }, { "name": "alfresco/menus/AlfMenuBarItem", "config": { "label": “Project" } }] } } }

#SummitNow How Really Cool This Is Last year, I built a Share UI: Page definition Template Instance Scripting Freemarker template CSS Javascript

#SummitNow How Really Cool This Is This year, I built this: LightboxAccordion Using this: In 30 Minutes!

#SummitNow How Really Cool This Is

#SummitNow Dojo in 10 Minutes

#SummitNow What is Dojo? It’s a Javascript Library! But seriously, it’s got a lot of really good stuff AMD (asynchronous module definition) Widget Templating Accessibility Constructs Unit Testing

#SummitNow What is Dojo? Base DijitDojoX Util (doh) Alfresco Core

#SummitNow Including Dojo Basic: <script type=“text/javascript” src=“www/js/dojo/dojo.js”>

#SummitNow Including Dojo However, Surf resolves everything for you (share/WEB-INF/surf.xml): /res/js/lib/dojo-1.9.0/dojo/dojo.js alfresco/core/Page /res/

#SummitNow Dojo Modules Dojo has a mechanism to define a module Dojo.provide(“myns.mycode”); Which you then include like this: Dojo.require(“myns.mycode”); However, this is just synchronous loading

#SummitNow Dojo Modules Asynchronous Module Definition (AMD): Uses “path” syntax instead of dots: “myns/mycode” New keyword and pattern: define([ "dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function( declare, _WidgetBase, _TemplatedMixin ){ return declare([ _WidgetBase, _TemplatedMixin ], {}); });

#SummitNow Dojo Modules New require format: require([ "dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin" ], function(declare, _WidgetBase, _TemplatedMixin){ // callback is optional }); This will be built automatically by Surf Cross domain loading is implicit!

#SummitNow Dojo Mixins Dojo provides a mechanism to “mix” objects together Base object + object to append Always mixin the alfresco/core/Core module Helps to resolve i18n strings correctly Other wrappers and Alfresco utility functions

#SummitNow The Dojo Event Model Pub/Sub Widget publishes events by name Consumers can subscribe to get the events, also by name Bubbling Event “bubbles up” the containing widgets until a handler is found

#SummitNow Dijit Widgets Dijit is a UI Widget Library Infrastructure: dijit._widgetBase dijit._TemplatedMixin Menu, Tree, Misc Widget sets Form Widgets Text, Button, ComboBox, Slider, etc. Layout Widgets Container, Border, Tab, Accordion, etc.

#SummitNow Widget Construction

#SummitNow Where we left off… LightboxAccordion

#SummitNow Share Widget Encapsulation Javascript + HTML + CSS + i18N

#SummitNow An Accordion Widget Base ours on the one in the Dijit library – AccordionContainer Takes ContentPanes as children Mixin the Alfresco Core to get the Alfresco pattern

#SummitNow An Accordion Widget Page JSON AlfAccordionContainer Alfresco Repo AlfContentPanel Instance and Parameters Call WS JSON Result

#SummitNow Widget Implementation Class is named by the filename Define and include mixins: define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "alfresco/core/Core", "dojo/text!./templates/AlfAccordionContainer.html", "dijit/layout/AccordionContainer", "dojo/_base/array"], function(declare, _Widget, _Templated, AlfCore, template, Accordion, array) { return declare([_Widget, _Templated, AlfCore], { define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "alfresco/core/Core", "dojo/text!./templates/AlfAccordionContainer.html", "dijit/layout/AccordionContainer", "dijit/layout/ContentPane", "dojo/_base/array"], function(declare, _Widget, _Templated, AlfCore, template, Accordion, ContentPane, array) { return declare([_Widget, _Templated, AlfCore], { // declare callback 1 for 1

#SummitNow Widget Implementation Next, pull in the CSS, i18n, and template: // snip… in the declare callback cssRequirements: [{cssFile:"./css/AlfAccordionContainer.css"}], i18nRequirements: [{i18nFile: "./i18n/AlfAccordionContainer.properties"}], templateString: template, //snip…

#SummitNow Widget Implementation Define a XHR function to make a call to the repo: // snip… in the declare callback: loadContent: function alfresco_accordion_AlfAccordionContainer__loadContent() { if ( this._contentLoaded ) { this.alfLog("log", “Content already loaded"); } else { this.alfLog("log", "Loading accordion content pages"); var url = this._contentUrl; if ( url == null ) { url = Alfresco.constants.URL_SERVICECONTEXT + “slidedecks/select"; if ( this.currentSite ) { url = url + "/site/" + this.currentSite; } this.serviceXhr({url : url, method: "GET", successCallback: this._contentDataLoaded, failureCallback: this._contentDataLoadFailed, callbackScope: this}); } },

#SummitNow Widget Implementation Build the accordion from the data in the postCreate method: //snip… in the declare callback: postCreate: function alfresco_accordion_AlfAccordionContainer__postCreate() { this._accordion = new Accordion( {} ); // add the array of panels built from the Xhr callback array.forEach( _panelList, function(panel, index) { _this._accordion.addChild( panel ); }); this._accordion.placeAt( this.containerNode ); },

#SummitNow Finishing My Page

#SummitNow Modifying the JSON { "name": "alfresco/layout/AlfSideBarContainer", "config": { "initialSidebarWidth": "300", "widgets": [{ "name": "alfresco/menus/AlfMenuBar", "align": "sidebar", // menu config…. }, { "name": "alfresco/accordion/AlfAccordionContainer", "align": "sidebar" } ]} }

#SummitNow The Prototype with the Accordion!

#SummitNow The Big Finish

#SummitNow What have we learned today? New AMD Infrastructure allows for decoupled encapsulated construction, plus rich features Page Construction all of the icky bits are hidden Widget Construction build and contribute whatever you need

#SummitNow Thanks UI Team!

#SummitNow Questions

#SummitNow