Latest Share Customization Techniques Dave Draper

Slides:



Advertisements
Similar presentations
Share Site Customizations Live
Advertisements

Java Script Session1 INTRODUCTION.
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
Apache Struts Technology
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
ONYX RIP Version Technical Training General. Overview General Messaging and What’s New in X10 High Level Print and Cut & Profiling Overviews In Depth.
The Web Warrior Guide to Web Design Technologies
Struts Basics SSE USTC Qing Ding. Agenda What is and Why Struts? Struts architecture – Controller: Focus of this presentation – Model – View Struts tag.
Peoplesoft: Building and Consuming Web Services
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
ICS 665 Jesse Abdul. jQuery UI Overview  jQuery UI javascript library Includes all UI component functionality  jQuery UI CSS framework Includes standard.
User Group 2015 Version 5 Features & Infrastructure Enhancements.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
Presented by…. Group 2 1. Programming language 2Introduction.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Accessibility for Rich Internet Applications: Colin Clark, Fluid Project Technical Lead, Adaptive Technology Resource Centre Techniques & Toolkits.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Building a UI with Zen Pat McGibbon –Sales Engineer.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Magnolia Modules. Architecture Web Application (WAR) Magnolia CoreGUICache Modules DMS 2.3Data 1.1Scheduler Custom Project Base 2.2 Project.
EQUELLA Product Strategy and Development
Extending ArcGIS for Server
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
ICONICS ActiveX ToolWorX V 6.1.
Enabling High-Quality Printing in Web Applications
Utterly Useless Widget creating your own Chameleon widget...
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
Computers and Scientific Thinking David Reed, Creighton University Functions and Libraries 1.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary June, 2011 Made available under the Eclipse Public License v Mobile.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Developing Great Dashlets Will Abson About Me Project Lead, Share Extras Alfresco Developer and previously Solutions Engineer DevCon 2011 –
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Bundles, Minification Andres Käver, IT Kolledž
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Leveraging Web Content Management in SharePoint 2013 Christina Wheeler.
Testing Your Alfresco Add-ons Michael Suzuki Software Engineer.
Developer Exam Preparation Thom Robbins Bryan Soltis
Apache Struts Technology A MVC Framework for Java Web Applications.
#SummitNow Alfresco 4.2 Share Development Workshop November 6, 2013 Kevin Dorr, Sr. Solutions Engineer, Alfresco US.
Wes Preston DEV 202. Audience: Info Workers, Dev A deeper dive into use-cases where client-side rendering (CSR) and SharePoint’s JS Link property can.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
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
Developing Great Dashlets Will Abson About Me Project Lead, Share Extras Alfresco Developer and previously Solutions Engineer DevCon 2011 –
Developing Great Dashlets Will Abson About Me Project Lead, Share Extras Alfresco Developer and previously Solutions Engineer DevCon 2011 –
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
Ext JS - Direct Bridging The Gap A DMSBT Presentation By Timothy Chandler.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
JavaScript, Sixth Edition
Actions and Behaviours
The Share Widget Library
Getting Started with Alfresco Development
z/Ware 2.0 Technical Overview
JavaScript CS 4640 Programming Languages for Web Applications
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

Latest Share Customization Techniques Dave Draper

Session Agenda (Very quick) overview of Share/Surf Review of customization enhancements What Share customization was like before version 4.0 What was added for Share version 4.0 An explanation of the Surf Extensibility Model What’s New in version 4.2 What’s next for Share

Key Things To Know Share is built on Surf Surf is an extension to Spring MVC “Is Surf moving backing Alfresco?”

History 2007 WebScripts 2008 Surf Share 3.0 and Share 3.2 Surf and WebScripts contributed to Spring 2010 Share 3.4 I joined Alfresco 2011 Surf converted to extensibility model (Share 4.0)

What Was Life Like Back in 2007 No iPhone (not until June anyway) No Android jQuery only just released (version 1.0, Aug 2006) Movies were still in 2D HD-DVD was still a viable option The global economy was still stable Spain were still rubbish at football

Region Chrome Anatomy of a Surf Page Page Template-Instance FreeMarker Template RegionsComponents Component Chrome WebScripts

Share Customization Prior to Version 4.0 Copy and paste to “web-extension” path Maintenance problems

Share Customization in version 4.0 Extensibility Model introduced into Surf Extension Module configuration Sub-Components Customizations SurfBug Document Library specific extension points

Document Library Extension Points Well defined, common, fine-grained use-cases No Surf changes Separate development effort

Extension Modules Three deployment modes: “auto” “enable-auto-deploy-modules” “manual” Evaluated once per request Default evaluation configuration can be overridden during manual deployment

Sub-Component extensions Addressed the problem of 1-1 mapping of Regions to Components Automatically generated from “legacy” Component configuration Allow default (Sub-)Components to be removed or replaced and for new Sub-Components to be added before or after Sub-Component evaluations allow for finer control of rendering

WebScript/Template Customizations Allows additions and overrides to i18n properties Allows model created by JavaScript controller to be manipulated Allows and directives in FreeMarker templates to be replaced or removed Allows new and directives to be added before or after existing directives

Please request for the directives that YOU need to be added to the Share WebScripts!!!

JavaScript Controller Customizations Run after default controller An opportunity to alter the model passed to template

Localization Customizations Update default WebScript properties for each request Most specific locale “wins”

Configuration Customization Configuration can be added to a module using element Generates a custom configuration model for each request Uses underlying ConfigService implementation Available in 4.0 service packs

Site_Conditional_Flash noflash.* false Example taken from:

The Surf Extensibility Model An in-memory buffer (a linked list of elements) FreeMarker directives manipulate elements A new model is opened for each FreeMarker template The following directives use the model: (can be nested)

Unbound Open Content Close Some text How Extensibility Model is Built Up

Adding Content Unbound Open Content Close id=“add” target=“MARKUP_1” action=“after”> Some MORE text Open Content Close “MARKUP_1”

Unbound Open Content Close Writer ExtensibilityModel flush() write() Unbound Open Content Close OutputStream flush()

The Problem: Only coarse grained customizations were possible The Solution: Make it easier to customize client-side JavaScript

How Client-Side Widgets Were Instantiated Region/Component WebScript Descriptor Controller “head” file FreeMarker template Localization Properties JavaScript resource CSS resource

Double Pass WebScript Processing head.get.head.ftl head.get.html.ftl WebScripts body1.get.head.ftl body1.get.html.ftl body2.get.head.ftl body2.get.html.ftl Styles1.css Functions1.js Styles2.css Functions2.js ${head}

Unbound Open Content Close ExtensibilityModel JavaScript / CSS import Deferred Open Close render()

Old Widget Instantiation

Share WebScript Refactor Conversion to a common “boiler-plate” template Client-side JavaScript widget definition moved into JavaScript controller All logic moved from FreeMarker template to JavaScript controller All JavaScript and CSS resource import statements moved into FreeMarker template Deprecation of *.head.ftl files

The “Boilerplate” …

Controller Model “widgets” Elements Object attributes: “id” “name” (required) “initArgs” (defaults to region id) “useOptions” (defaults to “true”) “options” “useMessages” (defaults to “true”) “assignTo”

New Widget Instantiation

Why Refactor? Consistency between WebScripts Easier to instantiate custom client-side JavaScript widgets A step towards performance improvements Moving towards disabling Surf Chrome and WebScript Head processing by default Moving towards JavaScript and CSS resource aggregation by default

Using JavaScript Extension Mechanism Create custom JavaScript widget that extends Alfresco version Use YAHOO.extend() function Override default functions Extend WebScript Customize FreeMarker template to add import for file containing custom widget Customize JavaScript controller to replace widget instantiation object Use widgetUtils.findObject(model.widgets, “id”, ) Change “name” attribute to reference new JavaScript widget

Module Custom DocumentList Widget org.alfresco.components.documentlibrary blog.demo.customization Example taken from:

Custom JavaScript // Declare namespace... if (typeof Blog == undefined || !Blog) { var Blog = {}; } if (!Blog.custom) { Blog.custom = {}; } (function() { // Define constructor... Blog.custom.DocumentList = function CustomDocumentList_constructor(htmlId) { Blog.custom.DocumentList.superclass.constructor.call(this, htmlId); return this; }; // Extend default DocumentList... YAHOO.extend(Blog.custom.DocumentList, Alfresco.DocumentList, { onFilterChanged: function CustomDL_onFilterChanged(layer, args) { // Call super class method... Blog.custom.DocumentList.superclass.onFilterChanged.call(this, layer,args); // Pop-up a message... Alfresco.util.PopupManager.displayMessage({ text: "Filter Changed!" }); } }); })(); Example taken from:

Custom FreeMarker template src="${url.context}/res/doclib/extension/custom-documentlist.js" group="documentlibrary"/> Example taken from: Custom JavaScript controller // Find the default DocumentList widget and replace it with the custom widget for (var i=0; i<model.widgets.length; i++) { if (model.widgets[i].id == "DocumentList") { model.widgets[i].name = "Blog.custom.DocumentList"; }

Surf Configuration Settings “use-checksum-dependencies” “aggregate-dependencies” “calculate-webscript-dependencies” “generate-css-data-images”

Checksum Dependencies Processed by the “dependency.handler” Spring bean org.springframework.extensions.surf.DependencyHandler Default Spring bean definition can be overridden to change debug and production suffices or the checksum digest (defaults to MD5) Production suffices: “-min” “-minified” “” Debug suffices “” “_src” “-debug”

Resource Aggregation Currently disabled by default (Share can be run with it enabled) Enabling may break 3 rd party extensions Improves performance by reducing the number of HTTP requests Includes inline JavaScript Removes all JavaScript from HTML source

Calculate WebScript Dependencies Still enabled by default Can be disabled if you don’t want to use Rich Media AMP Will be disabled by default in some future release Required for legacy extensions Empty *.head.ftl files are still processed so that extension versions are detected Please try to phase out the use of *.head.ftl files !

Generate CSS Data Images An alternative to CSS spriting Too consuming a task to convert Share to CSS sprites Use of CSS sprites would most likely break 3 rd party customizations Handles statements All must appear first in the file Relative paths are generated when image cannot be found Enabled by default

Dojo Support in Surf Surf now includes support for Dojo applications Programmatic implementations only Dojo version 1.7 applications or greater Uses existing resource aggregation capabilities to simulate Dojo build layers Dynamic dependency analysis Supports 3 rd party extensions

Why Have We Done This? Investigating future possibilities for developing Share YUI 2 is no longer being developed Simplify page development Move from coarse-grained, tightly-coupled “flat” widget structure to fine-grained, decoupled, nested widgets Improve customization/extensibility

Why Dojo? AMD (Asynchronous Module Definitions) Simple widget construction Excellent inheritance patterns Pub/Sub model Unit testing framework Comprehensive & consistent widget library Accessibility support Backed by big companies

2012 Summary Configuration customization support added Share WebScript refactoring Repository Extensibility Container Dynamic extension module support Surf Maven Archetype Dojo (1.7+) support in Surf

What Next For Share? It WON’T be replaced It WILL still be based on Surf It WILL feature new pages built on an improved client-side framework

Key Messages and Actions Performance and extensibility are key objectives for Share Share is going to continue to move forward Read the blogs Use the forums Ask questions Request extension points Raise bugs/feature requests on JIRA Come along to the Share Customization Live! session to see this in action

Questions?

FIN

FreeMarker Directive Factory Directive Factory defines the directives that are created (bean id: “directive.factory”) ProcessorModelHelper creates the directives (bean id: “processor.model.helper”) Custom directives can be written and provided to FreeMarker templates: Override default bean definitions to reference custom beans Override.populateTemplateModel() in ProcessorModelHelper to add additional FreeMarker directives Lots of interfaces and abstract classes that can be implemented/extended This approach is used for Alfresco Cloud service