SlideShare a Scribd company logo
1 of 9
VELOCITY 101
 BY PENNY KRONZ
PSA

• Cascade Server will always support XSLT
  development
WHAT IS XSLT & VELOCITY?

• Formatting language for XML
• In other words, translates XML into another
  language
• Why is this important?
TRAVERSING XML

• XSLT
  • <xsl:apply-templates select=“/path/to/node”/>
  • <xsl:template match=“node”/>


• Velocity
  • $_XPathTool.selectNodes($contentRoot, “/path/to/node”)
  • $_XPathTool.selectSingleNode($contentRoot, “/path/to/no
    de”)
  • $contentRoot.getChild(“path”).getChild(“to”).getChild(“no
    de”)
  • $contentRoot.getChildren()
COMMON SYNTAX

• Variables
  • #set ($myVar = “content value”)
• Loops
  • #foreach ($item in $items) Output Content #end
  • <xsl:for-each>Output Content</xsl:for-each>
• Conditional Statements
  • #if ($value == “value”) Output Content #end
  • <xsl:if test=“$value = „value‟”> Output Content </xsl:if>
• Dates
ADVANTAGES IN VELOCITY

•   Based on Java
•   Grouping
•   Conditional closing tags
•   More built-in Date functionality
•   Math
•   Arrays
•   Breaking out of loops
•   LEARNING CURVE
ADVANTAGES TO XSLT

• Testing code outside of Cascade Server
• Advanced editors outside of Cascade Server
COMMENT/QUESTIONS?
Penny Kronz
penny@hannonhill.com
678.904.6900 ext 255

More Related Content

What's hot

4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
Janos Rusiczki - Backbone.js - Models & views in JavaScript
Janos Rusiczki - Backbone.js - Models & views in JavaScriptJanos Rusiczki - Backbone.js - Models & views in JavaScript
Janos Rusiczki - Backbone.js - Models & views in JavaScriptkitsched
 
Tips for writing Javascript for Drupal
Tips for writing Javascript for DrupalTips for writing Javascript for Drupal
Tips for writing Javascript for DrupalSergey Semashko
 
php Slideshare
php Slidesharephp Slideshare
php SlideshareJason Liao
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introductionnklmish
 
Nothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive WebNothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive Webcolinbdclark
 
Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Julie Meloni
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuerycolinbdclark
 
Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)jeresig
 
An introduction to jQuery
An introduction to jQueryAn introduction to jQuery
An introduction to jQueryJames Wragg
 
JavaScript!
JavaScript!JavaScript!
JavaScript!RTigger
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDCMike Dirolf
 

What's hot (18)

4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Janos Rusiczki - Backbone.js - Models & views in JavaScript
Janos Rusiczki - Backbone.js - Models & views in JavaScriptJanos Rusiczki - Backbone.js - Models & views in JavaScript
Janos Rusiczki - Backbone.js - Models & views in JavaScript
 
Tips for writing Javascript for Drupal
Tips for writing Javascript for DrupalTips for writing Javascript for Drupal
Tips for writing Javascript for Drupal
 
php Slideshare
php Slidesharephp Slideshare
php Slideshare
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introduction
 
Nothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive WebNothing Hard Baked: Designing the Inclusive Web
Nothing Hard Baked: Designing the Inclusive Web
 
Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
 
Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)
 
SQL Provider
SQL ProviderSQL Provider
SQL Provider
 
Lecture 6: Client Side Programming 2
Lecture 6: Client Side Programming 2Lecture 6: Client Side Programming 2
Lecture 6: Client Side Programming 2
 
Ch. 7 beeing a jsp
Ch. 7 beeing a jsp     Ch. 7 beeing a jsp
Ch. 7 beeing a jsp
 
An introduction to jQuery
An introduction to jQueryAn introduction to jQuery
An introduction to jQuery
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
 
Jquery
JqueryJquery
Jquery
 
Jqueryppt (1)
Jqueryppt (1)Jqueryppt (1)
Jqueryppt (1)
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDC
 

Similar to Velocity 101 in Cascade Server CMS, by Penny Harding

SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Languageelliando dias
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your TemplatesThomas Weinert
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the ArtJakub Malý
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Rubysbeam
 
Scala for the doubters
Scala for the doubtersScala for the doubters
Scala for the doubtersMax Klyga
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionAdam Trachtenberg
 
In Pursuit of the Grand Unified Template
In Pursuit of the Grand Unified TemplateIn Pursuit of the Grand Unified Template
In Pursuit of the Grand Unified Templatehannonhill
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanshipbokonen
 
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天tblanlan
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-futureyiming he
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for DatabindingPaul Downey
 
Scaling Web Applications with Cassandra Presentation.ppt
Scaling Web Applications with Cassandra Presentation.pptScaling Web Applications with Cassandra Presentation.ppt
Scaling Web Applications with Cassandra Presentation.pptssuserbad56d
 
Scaling php applications with redis
Scaling php applications with redisScaling php applications with redis
Scaling php applications with redisjimbojsb
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Matthias Niehoff
 
Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Ramamohan Chokkam
 

Similar to Velocity 101 in Cascade Server CMS, by Penny Harding (20)

SXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup LanguageSXML: S-expression eXtensible Markup Language
SXML: S-expression eXtensible Markup Language
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
 
DB2 Native XML
DB2 Native XMLDB2 Native XML
DB2 Native XML
 
XML - State of the Art
XML - State of the ArtXML - State of the Art
XML - State of the Art
 
Day2 xslt x_path_xquery
Day2 xslt x_path_xqueryDay2 xslt x_path_xquery
Day2 xslt x_path_xquery
 
No SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in RubyNo SQL, No problem - using MongoDB in Ruby
No SQL, No problem - using MongoDB in Ruby
 
Scala for the doubters
Scala for the doubtersScala for the doubters
Scala for the doubters
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
 
In Pursuit of the Grand Unified Template
In Pursuit of the Grand Unified TemplateIn Pursuit of the Grand Unified Template
In Pursuit of the Grand Unified Template
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanship
 
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-future
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for Databinding
 
Jersey
JerseyJersey
Jersey
 
PostgreSQL and XML
PostgreSQL and XMLPostgreSQL and XML
PostgreSQL and XML
 
Scaling Web Applications with Cassandra Presentation.ppt
Scaling Web Applications with Cassandra Presentation.pptScaling Web Applications with Cassandra Presentation.ppt
Scaling Web Applications with Cassandra Presentation.ppt
 
Scaling php applications with redis
Scaling php applications with redisScaling php applications with redis
Scaling php applications with redis
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra
 
Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02Jsonsaga 100605143125-phpapp02
Jsonsaga 100605143125-phpapp02
 
All about scala
All about scalaAll about scala
All about scala
 

More from hannonhill

Cascade + Bootstrap = Awesome
Cascade + Bootstrap = AwesomeCascade + Bootstrap = Awesome
Cascade + Bootstrap = Awesomehannonhill
 
Web Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital TransformationWeb Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital Transformationhannonhill
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Serverhannonhill
 
Using Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page OptimizationUsing Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page Optimizationhannonhill
 
Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...hannonhill
 
Connecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade ServerConnecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade Serverhannonhill
 
Data Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JSData Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JShannonhill
 
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...hannonhill
 
Fun with Cascade Server!
Fun with Cascade Server!Fun with Cascade Server!
Fun with Cascade Server!hannonhill
 
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
Accessibility in Practice:  Integrating Web Accessibility into Cascade TrainingAccessibility in Practice:  Integrating Web Accessibility into Cascade Training
Accessibility in Practice: Integrating Web Accessibility into Cascade Traininghannonhill
 
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade ServerCrowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Serverhannonhill
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...hannonhill
 
Climbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground UpClimbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground Uphannonhill
 
Cusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding PlatformCusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding Platformhannonhill
 
Web Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and SimplicityWeb Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and Simplicityhannonhill
 
Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!hannonhill
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Serviceshannonhill
 
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...hannonhill
 
Redesign in Cascade Server
Redesign in Cascade ServerRedesign in Cascade Server
Redesign in Cascade Serverhannonhill
 

More from hannonhill (20)

Cascade + Bootstrap = Awesome
Cascade + Bootstrap = AwesomeCascade + Bootstrap = Awesome
Cascade + Bootstrap = Awesome
 
Web Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital TransformationWeb Governance Crash Course: Creating a Sustainable Digital Transformation
Web Governance Crash Course: Creating a Sustainable Digital Transformation
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
Using Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page OptimizationUsing Cascade technology to increase SEO/Landing Page Optimization
Using Cascade technology to increase SEO/Landing Page Optimization
 
Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...Information Architecture and User Experience: The Journey, The Destination, T...
Information Architecture and User Experience: The Journey, The Destination, T...
 
2 Men 1 Site
2 Men 1 Site2 Men 1 Site
2 Men 1 Site
 
Connecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade ServerConnecting Ecommerce & Centralized Analytics to Cascade Server
Connecting Ecommerce & Centralized Analytics to Cascade Server
 
Data Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JSData Modeling with Cascade Server and HighCharts JS
Data Modeling with Cascade Server and HighCharts JS
 
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
Modernizing Internal Communications with Cascade Server, WordPress and MailCh...
 
Fun with Cascade Server!
Fun with Cascade Server!Fun with Cascade Server!
Fun with Cascade Server!
 
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
Accessibility in Practice:  Integrating Web Accessibility into Cascade TrainingAccessibility in Practice:  Integrating Web Accessibility into Cascade Training
Accessibility in Practice: Integrating Web Accessibility into Cascade Training
 
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade ServerCrowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
Crowdsourced Maps: From Google Forms to Fusion Tables to Cascade Server
 
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...	Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
Superautomatic! Data Feeds, Bricks, and Blocks, with Server-side Transformat...
 
Climbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground UpClimbing Migration Mountain: 200+ Sites from the Ground Up
Climbing Migration Mountain: 200+ Sites from the Ground Up
 
Cusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding PlatformCusestarter or How We Built Our Own Crowdfunding Platform
Cusestarter or How We Built Our Own Crowdfunding Platform
 
Web Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and SimplicityWeb Services: Encapsulation, Reusability, and Simplicity
Web Services: Encapsulation, Reusability, and Simplicity
 
Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!Cascade Server: Past, Present, and Future!
Cascade Server: Past, Present, and Future!
 
Web Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web ServicesWeb Forms, or How I Learned to Stop Worrying and Love Web Services
Web Forms, or How I Learned to Stop Worrying and Love Web Services
 
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...Outputting Their Full Potential: Using Outputs for Site Redesigns andDevelo...
Outputting Their Full Potential: Using Outputs for Site Redesigns and Develo...
 
Redesign in Cascade Server
Redesign in Cascade ServerRedesign in Cascade Server
Redesign in Cascade Server
 

Velocity 101 in Cascade Server CMS, by Penny Harding

  • 1. VELOCITY 101 BY PENNY KRONZ
  • 2. PSA • Cascade Server will always support XSLT development
  • 3. WHAT IS XSLT & VELOCITY? • Formatting language for XML • In other words, translates XML into another language • Why is this important?
  • 4. TRAVERSING XML • XSLT • <xsl:apply-templates select=“/path/to/node”/> • <xsl:template match=“node”/> • Velocity • $_XPathTool.selectNodes($contentRoot, “/path/to/node”) • $_XPathTool.selectSingleNode($contentRoot, “/path/to/no de”) • $contentRoot.getChild(“path”).getChild(“to”).getChild(“no de”) • $contentRoot.getChildren()
  • 5. COMMON SYNTAX • Variables • #set ($myVar = “content value”) • Loops • #foreach ($item in $items) Output Content #end • <xsl:for-each>Output Content</xsl:for-each> • Conditional Statements • #if ($value == “value”) Output Content #end • <xsl:if test=“$value = „value‟”> Output Content </xsl:if> • Dates
  • 6. ADVANTAGES IN VELOCITY • Based on Java • Grouping • Conditional closing tags • More built-in Date functionality • Math • Arrays • Breaking out of loops • LEARNING CURVE
  • 7. ADVANTAGES TO XSLT • Testing code outside of Cascade Server • Advanced editors outside of Cascade Server

Editor's Notes

  1. Content is stored in Cascade Server as XML. Content is retrieved via the index block. Whether it be from a Data Definition or a folder structure.
  2. Velocity and XSLT select statements use the same syntax.Caveat: Two ways of selecting in Velocity – Single node v Multiple nodes
  3. Grouping – Muenchian grouping