Ajax, XSLT and SVG Displaying ATLAS conditions data with new web technologies Shaun Roe 1Ajax, XSLT & SVG (Shaun Roe, Atlas)CHEP'09 Prague.

Slides:



Advertisements
Similar presentations
1/7 ITApplications XML Module Session 8: Introduction to Programming with XML.
Advertisements

CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
HTTP Request/Response Process 1.Enter URL ( in your browser’s address bar. 2.Your browser uses DNS to look up IP address of server.com.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
1/18 ITApplications XML Module Session 5: Extensible Stylesheet Language (XSL)
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Project 1 Introduction to HTML.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
AJAX & By – Anupama Sharma. Defining Ajax Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together.
INTRODUCTION The Group WEB BROWSER FOR RELATION Goals.
Multiple Tiers in Action
ITWS-2210 / CSCI Logistics Format – Class w/ mini projects (graded on class participation) – Labs (individual projects, graded on completion in.
W3C Activities HTML: is the lingua franca for publishing on the Web XHTML: an XML application with a clean migration path from HTML 4.01 CSS: Style sheets.
A RESTful Web Service Interface to the ATLAS COOL Database Shaun Roe 1A RESTful Web Service... (Shaun Roe, Atlas)CHEP'09 Prague.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
HTML 1 Introduction to HTML. 2 Objectives Describe the Internet and its associated key terms Describe the World Wide Web and its associated key terms.
Chapter ONE Introduction to HTML.
WEB DESIGN SOME FOUNDATIONS. SO WHAT IS THIS INTERNET.
Web Design Basic Concepts.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
What is Web Design?  Web design is the creation of a Web page using hypertext or hypermedia to be viewed on the World Wide Web.
Creating a Basic Web Page
CS 4720 RESTfulness and AJAX CS 4720 – Web & Mobile Systems.
Server-side Scripting Powering the webs favourite services.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Introduction to InfoSec – Recitation 7 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
Session II Chapter 2 – Chapter 2 – XSLhttp://
DSpace UI Alexey Maslov. DSpace in general A digital library tool useful for storage, maintenance, and retrieval of digital documents Two types of interaction:
HTML, XHTML, and CSS Sixth Edition Chapter 1 Introduction to HTML, XHTML, and CSS.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
Browsing MITA Seminar 2003 Mikko Pohja & Alessandro Cogliati.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
Session I Chapter 1 - Introduction to Web Development
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
XML and SVG as an Aid to Distance Learning Lez Bullwer MSc Information Technology.
Session 1 Chapter 1 - Introduction to Web Development ITI 133: HTML5 Desktop and Mobile Level I
Asstt. Prof Sonia Sharma Computer Dept 1 HTML ( Hypertext MarkUP Language ) HTML is the lingua franca for publishing hypertext on the World Wide Web.
HTML Concepts and Techniques Fifth Edition Chapter 1 Introduction to HTML.
Chapter 1 Introduction to HTML, XHTML, and CSS HTML5 & CSS 7 th Edition.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
Overview Web Technologies Computing Science Thompson Rivers University.
Database application development 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall OBJECTIVES  Define terms  Explain three components.
1 LM 6 Database Applications Dr. Lei Li. Learning Objectives Explain three components of a client-server system Describe differences between a 2-tiered.
Web Technology Overview with a focus on JavaScript-based technologies Lawrence Yao
Session IV Chapter 14 – Chapter 14 – XSLThttp://
Web Technologies HTML Dr. Mohammad Ahmad S15. Technologies Overview List of Technologies Client Side Technologies HTML, CSS, JavaScript, VBScript XHTML,
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Web Technologies Computing Science Thompson Rivers University
JavaScript and Ajax (Ajax Tutorial)
Chapter 1 Introduction to HTML.
AJAX and REST.
AJAX.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Introduction to Internet Programming
PHP + Oracle = Data-Driven Websites
CMP Creating Your Personal and Small Business Web Sites
HTML5 Level I Session I Chapter 1 - Introduction to Web Development
Introduction to World Wide Web
Web Technologies Computing Science Thompson Rivers University
Client-Server Model: Requesting a Web Page
Presentation transcript:

Ajax, XSLT and SVG Displaying ATLAS conditions data with new web technologies Shaun Roe 1Ajax, XSLT & SVG (Shaun Roe, Atlas)CHEP'09 Prague

Aim CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)2 Web page formdb SQL active graph parameters Don’t want the web page to ‘blink’ => insert the graph to the page in memory Want the graph to have hyperlinks, where appropriate=> ? Would like the output format to be flexible => separate presentation from information

Yesterday’s alternatives CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)3 Web page form parameters SQL reply reformat Graph server (or process) Bitmap? Flash? new page

A plan CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)4 So I need: 1. A way of getting xml from the database 2. A stylesheet to format xml so it looks like a graph 3. A way of injecting that graph… Web page form db SQL XML parameters stylesheet

XML from Oracle CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)5 (I’m dealing with Oracle. For MySQL, see xaware.org.) SELECT DBMS_XMLGEN.GETXML( ‘query’ ) XML FROM DUAL It’s (almost) that simple. In practice, have to be careful about quotes: $query = “SELECT TO_CHAR(A.TS, ''YYYY-MM-DD HH24:MI:SS'') AS …”; The replyGreat! Is there more like this? SCT BAR PS Q2 B303 ch8000 lay0 phi12 eta06 HVchVolt AUG AM Form sub nodes with subqueries using oracle ‘cursor’ function Stored functions allow one to page the xml Stylesheets can be stored and applied on the DB. XMLDB package allows one to create an XML server on the DB which responds to http calls.

Styling and Transforming XML CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)6 CSS ROWSET { font-family:arial, helvetica, sans-serif; text-align:left; margin:10px; display: table; border-width: 1px; border-style: solid; } ROW { display:table-row; visibility: visible; font-size: 10pt; } ROW > * { display:table-cell; border-width: 1px; border-style: solid; padding: 4px; } XSLT Allows radical restructuring; the stylesheet is a complete programming language. Simple XSLT A simple demo of xslt The average of all HV values is: V Cascading Style Sheets XML Stylesheet Language for Transformations

Example of XSLT applied CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)7 Blocks are printed; their colour and position are determined by a CSS. For each element, the time average has been calculated and inserted as a tooltip 44 LOC, excluding CSS Everything calculated by the browser Bias voltage

SVG: A Graphical web standard CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)8 Wouldn’t it be great if this worked: This is a circle Show a circle SVG embedded inline in XHTML SVG embedded inline in XHTML This does work: Scalable Vector Graphics A W3C recommendation Understood natively by Firefox, Safari, Opera Probably on your mobile phone Almost certainly in your digital TV..and IE? (Vector Markup Language)

Extreme SVG CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)9 zoom … JiveXML

js Ajax CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)10 Asynchronous Javascript And XML A way of changing web pages in memory Form POST New page XHR XML Alter the existing document Xml Http Request Forming an XHR is browser specific, so use a common javascript library: prototype function bindForm(){ $('formInputs').observe('submit', function(e){ e.stop(); new Ajax.Request( this.action, { method: 'get', parameters: this.serialize(), onSuccess: function(r){… var iframe=new Element('iframe',{'src': url, 'height':'800px', 'frameborder':'0'}); $(’results').update(iframe); …}.

Putting it together CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)11 Inserted via Ajax XML, styled and transformed

Variations CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)12 I’ve shown simply providing an XML which is associated with an XSLT stylesheet; the browser does the transformation. XSLT is now common enough that the transform can be done at various stages: In Oracle: one can store stylesheets in the database and request one of them to be used before sending the data. On the server: PHP, Python, Perl all have interfaces to the XSLT engine. js Explicitly from javascript: An Ajax request can be made to retrieve a stylesheet to be applied. These alternatives allow one to associate different stylesheets ‘on the fly’ and parametrize them (providing arguments to them).

Conclusion CHEP'09 PragueAjax, XSLT & SVG (Shaun Roe, Atlas)13 The combination of XML, XSLT and SVG provides a straightforward way to produce ‘active’ graphics, naturally separating information from presentation Ajax provides a seamless interaction between web page and server The whole is a code-efficient way to produce graphics from database queries Lines Of Code (excluding css): HTML: 74 Js:46 PHP: 108 (of which SQL is ~20 lines) XSL:44 (table) (graph) = 177 Total: 405 LOC (Thanks)