Python template engines and implementation in Indico Marius Damarackas (Vilnius University)

Slides:



Advertisements
Similar presentations
Copyright 2001, ActiveState. XSLT and Scripting Languages or…XSLT: what is everyone so hot and bothered about?
Advertisements

Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
compilers and interpreters
.Graph for Excel Enhancing the Graphics Production Process at the OECD
Usage of the memoQ web service API by LSP – a case study
Sharpen Your MVC Views with Razor By Jon Marozick.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Adaptability of learning objects by appropriate knowledge representation Anastas Misev Institute of Informatics Faculty of Natural Science and Mathematics.
Programming Creating programs that run on your PC
Software Evolution Managing the processes of software system change
DT211/3 Internet Application Development
Information Extraction from Documents for Automating Softwre Testing by Patricia Lutsky Presented by Ramiro Lopez.
HEPiX Fall Meeting 2005 Thomas Baron – CERN – IT Indico: An Event Management Software (and more)
Types of software. Sonam Dema..
Terms: Test (Case) vs. Test Suite
UFCEKG-20-2 Data, Schemas & Applications Lecture 4 Server Side Scripting & PHP.
Program development & programming languages Chapter 13.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
WorkPlace Pro Utilities.
XML and XSL Institutional Web Management 2001: Organising Chaos.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Designing For Testability. Incorporate design features that facilitate testing Include features to: –Support test automation at all levels (unit, integration,
SB ScriptBasic Introduction to ScriptBasic There are more people writing programs in BASIC than the number of people capable programming.
Chapter 8 Script-free pages. Problem with scripting in JSP When you use scripting (declaration, scriplet, expressions) in your JSP, you actually put Java.
Verification and Test Automation of UML Projects Nikita Voinov, Vsevolod Kotlyarov (Saint-Petersburg State Polytechnic University) The Third Spring Young.
Program Development Life Cycle (PDLC)
Presenter : Ching-Hua Huang 2013/7/15 A Unified Methodology for Pre-Silicon Verification and Post-Silicon Validation Citation : 15 Adir, A., Copty, S.
Program documentation Using the Doxygen tool Program documentation1.
New Printing Options from RTF Charles Engelke Info Tech, Inc. Trnsport Users’ Group October 15, 2004.
Using CookCC.  Use *.l and *.y files.  Proprietary file format  Poor IDE support  Do not work well for some languages.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
From DNA to.NET Design Path. Objectives Sketch up a typical Win DNA Application Sketch up the.NET version Compare Design and Implementation Advantages.
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
LCG-SPI: SW-Testing LCG AppArea internal review (20/10/03)
An OBSM method for Real Time Embedded Systems Veronica Eyo Sharvari Joshi.
I Power Higher Computing Software Development Development Languages and Environments.
Semi-Automatic patch upgrade kit
EGEE is a project funded by the European Union under contract IST Tools survey status, first experiences with the prototype Diana Bosio EGEE.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Intermediate 2 Computing Unit 2 - Software Development Topic 2 - Software Development Languages and Environments.
Martin Kruliš by Martin Kruliš (v1.1)1.
HNDIT23082 Lecture 06:Software Maintenance. Reasons for changes Errors in the existing system Changes in requirements Technological advances Legislation.
The New Solution? Translate XHTML to Java GUI.. Advantages Using XML W3C support XSLT Language Testing Language Specification Using XHTML Reuse web tools.
1 Software Maintenance The process of changing the system after it has been delivered and in operation Software change is inevitable –New requirements.
1 Integration of the LCP Reporting Into the E-PRTR Scope and Technical proposal November 3rd.
1 Integration of the LCP Reporting Into the E-PRTR Scope and Technical specifications December 3rd.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Software tools for digital LLRF system integration at CERN 04/11/2015 LLRF15, Software tools2 Andy Butterworth Tom Levens, Andrey Pashnin, Anthony Rey.
Contents What is Reverse Engineering (RE)? Why do we need Reverse Engineering? Scope and Tasks of Reverse Engineering Reverse Engineering Tools Reverse.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
1 Integration of the LCP Reporting Into the E-PRTR Current status and Technical proposal August 4th.
CERN, 7 November 2011 Anton Pytel Slovak Technical University TRIP FROM GENERATORS TO GEOMETRIES.
Technologies and Characteristics Outline Description –Architecture –ER Model –Pages Template Reasons of some choices Problems Encountered Some.
Re Write POGO using openArchitectureWare Technology ● Pogo History ● OpenArchitectureWare technology ● Generated code ● Project status.
Slice & dice the Web with XmlPL, The XML Processing Language A presentation for Boise Code Camp 2007 Joseph Coffland Cauldron Development LLC.
SNiPER在LHAASO实验中的应用: LodeStar
Environment Assessment
FESA evolution and the vision for Front-End Software
Unit# 8: Introduction to Computer Programming
Marketo Programs: How to Utilize Templates, Tokens and Analytics
CSE 303 Concepts and Tools for Software Development
Presents: Rally To Java Conversion Suite
Discussing an OVS/OVN Split
Automation of Control System Configuration TAC 18
Presentation transcript:

Python template engines and implementation in Indico Marius Damarackas (Vilnius University)

About me Software engineering student Doing 3 months long internship in CERN Improving Indico template system 2

Outline 1.History of Indico templates 2.Why change the current system? 3.Main tasks Research about available template systems Integration of the new engine Replacing XSLT with normal templates 4.Remaining work 3

History of Indico templates First generation 4 >>> ' %(param)s ' % {'param' : 'Value'} ' Value '

History of Indico templates Second generation 5 foobar foobar

Why change the current system? Maintenance costs Slow when including other templates No cache No HTML escaping Strange usage of the colon symbols: 6

1. Research Some of the candidates ▫Genshi ▫Mako ▫Cheetah ▫Jinja2 7

1. Research Genshi ▫Claims to be the fastest XML template engine ▫Used by Trac ▫XML and Text versions ▫Features like caching, XSS protections ▫Slow ▫Very difficult to translate Indico templates 8

1. Research Mako ▫Used by python.org and reddit.com ▫Very fast: compiles to Python modules ▫Allows to disable Unicode (a plus for Indico) ▫Template inheritance mechanism ▫Syntax could be better, more unified 9

1. Research Jinja2 ▫Quite fast ▫Template inheritance ▫Strong separation of logic and presentation ▫Difficult to adapt to Indico Cheetah ▫Manual compilation to Python modules  Mako does it automatically ▫Personally I did not like the syntax 10

2. Integration Replace old engine code with TemplateLookup Problem: more than 800.tpl files to translate 11

2. Integration Using a script to convert files Mainly based on regexps Some things needed to be changed by hand 12

2. Testing integration Basic idea to test the integration: ▫use *both* old Indico and new Mako templates Generate outputs and do diff If there are significant differences, save them Analyze differences and fix the script 13

2. Testing integration Coverage: 450+ out of 800 templates 56%, but higher if we count only active files Allowed to catch some bugs in the script 14

3. Replacing XSLT 15

3. Replacing XSLT Generates XML, then applies transformations Slow Different from other parts of the system Lots of code duplication Difficult to maintain 16

3. Replacing XSLT Maintenance problems 17 … if (chatInfoState]]> <![CDATA[').dom.className = "CRDisplayMoreInfo"; … if (chatInfoState]]> <![CDATA[').dom.className = "CRDisplayMoreInfo"; …

3. Replacing XSLT Same code in human language 18 … if (chatInfoState${id}) { IndicoUI.Effect.slide('collaborationInfoLine${id}', height${id}); $E('CRMoreInfo${id}').set('More info'); $E('CRMoreInfo${id}').dom.className = "CRDisplayMoreInfo"; … if (chatInfoState${id}) { IndicoUI.Effect.slide('collaborationInfoLine${id}', height${id}); $E('CRMoreInfo${id}').set('More info'); $E('CRMoreInfo${id}').dom.className = "CRDisplayMoreInfo"; …

3. Replacing XSLT Performance: ▫Changing the way parameters are passed ▫No XML Maintenance: ▫Most of the styles are similar ▫Using Mako template inheritance 19

Remaining work Think of a smart way to restructure event styles Fix the i18n script to support the new syntax 20

Thank you 21