SlideShare a Scribd company logo
1 of 34
A Groovy Way to Interface With 
Cascade Server 
Creating a Phone Directory & Course Pages 
Tom Wilkinson 
Cuyahoga Community College
This presentation is for you if 
• You have written programs in some procedural 
object oriented language 
• You have created Data Definitions and Velocity 
or XSLT formats in Cascade 
• You are familiar with Active Directory 
• You are familiar with Web Services 
• You need to develop interfaces to Cascade 
• You know or are willing to learn Groovy
About Me 
• Worked at the Tri-C full time since 1974 
• Worked in IT since 1980 
• Worked with C# since 2005 
• Worked with HTML, CSS and JavaScript since 
2008 
• Worked with Groovy since 2013 
• Married with 3 adult children, 2 grandchildren 
and 3 dogs
Agenda 
• About Cuyahoga Community College 
• About Our Project 
• Groovy 
• Phone Directory 
• Velocity 
• Workforce Training Course Pages 
• Structured Data Nodes 
• Questions
About Cuyahoga Community College 
• First Community College in Ohio, opened in 
1963 
• 1,000 credit courses each semester 
• 600 non-credit courses are offered annually 
• 60,000 credit and non-credit students each 
year 
• 4 campus locations and 7 other sites
Cuyahoga Community College 
Tri-C
About Cuyahoga Community College 
Student Profile 
• Average age is 29 years old 
• Student ages range from 15 to 75+ 
• 61% are women 
• 39% are from minority groups 
• 65% study part-time 
• 56% are seeking an associate degree or are taking courses 
to prepare for transfer to a four-year institution 
• 30% are focusing in areas related to health careers 
• 17% attend only evening or weekend classes 
• 67% are enrolled in technical job training courses 
• 17% are enrolled in business programs
About Our Project 
Goals 
• Create one site to serve both mobile and 
desktop 
• Fast site with less pages, images and 
documents that are more timely and accurate 
• A CMS platform that is easy to maintain and 
update 
• A CMS that will allow us the flexibility to 
modify CSS, HTML and JavaScript quickly to 
meet Interactive Communications needs
About Our Project 
Current Status 
• We plan to go live with the new site the third 
week of November 2014 
• We had Cascade for 1.5 years but the project 
was delayed by non-technical reasons 
• Curent site has over 2,500 pages, over 6,200 
documents and over 3,400 images
Groovy 
Why? 
• PHP is forbidden by our Office of Safe and 
Secure Computing 
• Works with Cascade Web Services 
• Easy for C# developers to understand 
• Less verbose then Java 
• Can (practically) do anything Java can do 
• Banner XE uses Groovy
Groovy 
Sample Code 
1. package groovytest 
2. import groovy.sql.Sql 
3. class NewGroovyClass { 
4. static main(args) { 
5. def configFile = new File('config.groovy').toURI().toURL(); 
6. def config = new ConfigSlurper().parse(configFile) 
7. def sql = Sql.newInstance(config.sqlConnection) 
8. sql.eachRow( 'select * from Status' ) { 
9. println "$it.id -- ${it.Name}" 
10. } 
11. } 
12. } 
config.groovy: 
sqlConnection = 'jdbc:jtds:sqlserver://testserver/Test_DB'
Phone Directory 
Overview
Phone Directory 
Process Part 1 
• Groovy application queries Active Directory 
for all staff that are not hidden 
• Reformats department names and locations 
• Creates XML document on an internal web 
server
Phone Directory 
Process Part 2 
• Cascade reads in XML feed block during page 
publishing and a velocity script converts it to 
JSON and imbeds it in the Phone Directory 
page 
• The published Phone Directory page is a Single 
Page Application (SPA) containing the search 
functionality
Phone Directory 
Tool 
• Gradle 1.8 
• IntelliJ IDEA 13.1 (or whatever you like) 
• Visual Studio 2013 for HTML, CSS and 
JavaScript (or whatever you like)
Phone Directory 
Libraries 
• Groovy 2.3.3 
• org.apache.directory.api 1.0.0-M24 
• groovy-ldap 
• org.slf4j 1.7.7 
• ch.qos.logback 1.1.2 
• activation 1.0.2 
• javax.mail 1.4.7 
• Jquery 1.11 
• Telerik Kendo UI (JavaScript Library)
Groovy LDAP 
with Apache Directory LDAP API 
def ret = new ArrayList<Person>() 
def ldap = LDAP.newInstance(uri, user, password) 
ldap.eachEntry ("(&(objectclass=user)(objectcategory=person)(employeeNumber=*))") { person -> 
def p = new Person() 
p.department = DepartmentFilter(person.department) 
p.email = person.mail 
p.fax = person.facsimiletelephonenumber 
p.isFaculty = IsFaculty(person.memberof) 
p.location = MakeLocation(person.businesscategory, person.streetaddress) 
p.name = MakeName(person.sn, person.givenname, person.middlename, person.personaltitle) 
p.firstName = person.givenname 
p.lastName = person.sn 
p.phone = person.telephonenumber 
p.room = person.physicaldeliveryofficename 
p.title = person.title 
ret << p 
}
Phone Directory 
Groovy Classes 
Class Name Description 
App Setups logging, deletes old logs files, reads 
configuration file, calls ADInterface to get 
user, calls XMLGenerater to output XML file 
ADInterface Get all unhidden employees, fixes department 
names and locations 
Person DTO from ADInterface to XMLGenerator 
XMLGenerator Creates XML file with person, department and 
location nodes 
DESCodec Decrypt AD users password from 
configuration file 
LogUtility Delete old log files
Phone Directory 
Execution 
• Extracted 269 departments 
• Extracted 11 locations 
• Extracted 3847 people 
• Normal end took 1 minutes, 2.314 seconds
Phone Directory 
Demo
Velocity 
Tips 
• Empty inner HTML is turn into an empty tag 
<a href=“#”></a>  <a href=“#”/> 
<a href=“#”> </a>  <a href=“#”></a> 
• #set will not work with nulls 
#set($x = ‘old value’) 
#set($x = function-that-return-null()) 
$x is still ‘old value’ 
• Must manually escape  and “ before using 
$_EscapeTool.javascript for JSON
Workforce Training Course Pages 
Overview
Workforce Training Course Pages 
Process 
• Retrieve all workforce courses, sections and 
prerequisites 
• Update or Create corresponding course page 
• Remove any course pages not in the database
Workforce Training Course Pages 
Tools 
• Maven 3.0.5 
• Gradle 1.8 
• IntelliJ IDEA 13.1 (or whatever you like)
Workforce Training Course Pages 
Libraries 
• Cascade Web Service generated from WSDL 
• axis 1.4 
• Jtds 1.3.1 
• Jsoup 1.7.3 
• Groovy 2.3.3 
• org.slf4j 1.7.7 
• ch.qos.logback 1.1.2 
• activation 1.0.2 
• javax.mail 1.4.7
Workforce Training Course Pages 
Groovy Classes 
Class Description 
App Sets up logging, reads configuration file, deletes old log files, 
setup AdvantageInterface and CascadeInterface then calls 
BusinessLogic 
BusinessLogic Gets courses, sections and prerequisites using 
AdvantageInterface and updates course pages in Cascade 
using CascadeInterface, removes old course pages 
AdvantageInterface Uses SQL Queries to get Courses, sections and prerequisites 
Course DTO for courses 
Prerequisite DTO for prerequisites 
Section DTO for sections 
CascadeInterface Lists pages, reads, updates and copies pages 
LogUtility Delete old log files
Workforce Training Course Pages 
Execution 
• Using 45 programs 
• Retrieved 518 courses 
• Retrieved 3422 sections 
• Retrieved 202 prerequisites 
• Created page course-7249 
• Created 1 pages and updated 517 pages 
• Deleted 0 pages 
• Normal end took 32 minutes, 16.050 seconds
StructuredDataNode 
Text 
1. private static StructuredDataNode 
CreateNode(String name, String value) { 
2. def node = new StructuredDataNode() 
3. node.type = StructuredDataType 
4. .fromValue(StructuredDataType._text) 
5. node.identifier = name 
6. node.text = value?.trim() ? value : null 
7. return node 
8. }
StructuredDataNode 
Checkbox 
1. private static StructuredDataNode CreateNodeOfCheckbox(String name, 
Boolean value) { 
2. def final checkbox = '::CONTENT-XML-CHECKBOX::' 
3. def node = new StructuredDataNode() 
4. node.type = StructuredDataType.fromValue(StructuredDataType._text) 
5. node.identifier = name 
6. if (value) { 
7. node.text = "${checkbox}Yes" 
8. } else { 
9. node.text = checkbox 
10. } 
11. return node 
12. }
StructuredDataNode 
HTML 
1. private static StructuredDataNode CreateNodeHtml(String name, 
String value) { 
2. def node = new StructuredDataNode() 
3. node.type = StructuredDataType 
4. .fromValue(StructuredDataType._text) 
5. node.identifier = name 
6. if (value?.trim()) { 
7. node.text = Jsoup.clean(value, Whitelist.basic()) 
8. } else { 
9. node.text = null 
10. } 
11. return node 
12. }
StructuredDataNodes 
1. data += CreateNodeOfDate('updated', course.updated) 
2. for (Prerequisite p in course.prerequisites) { 
3. def prerequisite = [] 
4. prerequisite += CreateNodeOfInt('id', p.id) 
5. prerequisite += CreateNode('code', p.code) 
6. prerequisite += CreateNode('number', p.number) 
7. prerequisite += CreateNode('name', p.name) 
8. prerequisite += CreateNode('comment', p.comment) 
9. data += CreateNodeOfNodes('prerequisites', 
CreateNodes(prerequisite.toList())) 
10. }
Resources 
Books 
• Groovy in Action by Dierk König, Guillaume 
Laforge, Paul King and Cédric Champeau 
• Programming Groovy 2: Dynamic Productivity 
for the Java Developer (Pragmatic Bookshelf) 
by Venkat Subramaniam 
• Velocity: The Basics: Scripting with a $ here 
and a # to do by James Johnson
Resources 
Web 
• http://groovy.codehaus.org/ 
• http://directory.apache.org/api/groovy-ldap.html 
• http://www.gradle.org/ 
• http://www.jetbrains.com/idea/ 
• http://www.slf4j.org/ 
• http://logback.qos.ch/ 
• http://www.telerik.com/kendo-ui 
• http://jsoup.org/ 
• http://jtds.sourceforge.net/ 
• https://github.com/hannonhill/Webservices-Java- 
Sample-Project
Questions 
• tom.wilkinson@tri-c.edu 
• (216) 987-3666 
• Github: https://github.com/Tri-C

More Related Content

What's hot

Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginnersRahul Jain
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVABALUJAINSTITUTE
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVABALUJAINSTITUTE
 
Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Roselin Mary S
 
Oracle database 12c sql worshop 1 student guide vol 2
Oracle database 12c sql worshop 1 student guide vol 2Oracle database 12c sql worshop 1 student guide vol 2
Oracle database 12c sql worshop 1 student guide vol 2Otto Paiz
 
2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the ContextRussell Castagnaro
 
JSP - Part 2 (Final)
JSP - Part 2 (Final) JSP - Part 2 (Final)
JSP - Part 2 (Final) Hitesh-Java
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer ReferenceMuthuselvam RS
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentationguest11106b
 

What's hot (12)

Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
JSP
JSPJSP
JSP
 
Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml Service Oriented Architecture -Unit II - Modeling databases in xml
Service Oriented Architecture -Unit II - Modeling databases in xml
 
Oracle database 12c sql worshop 1 student guide vol 2
Oracle database 12c sql worshop 1 student guide vol 2Oracle database 12c sql worshop 1 student guide vol 2
Oracle database 12c sql worshop 1 student guide vol 2
 
2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the Context
 
JSP - Part 2 (Final)
JSP - Part 2 (Final) JSP - Part 2 (Final)
JSP - Part 2 (Final)
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 

Similar to A Groovy Way to Interface With Cascade Server

Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=HibernateJay Shah
 
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in PracticeOpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in PracticeJesse Gallagher
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developerscacois
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
03 form-data
03 form-data03 form-data
03 form-datasnopteck
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptLucidworks
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
How to use the new Domino Query Language
How to use the new Domino Query LanguageHow to use the new Domino Query Language
How to use the new Domino Query LanguageTim Davis
 
Library management system
Library management systemLibrary management system
Library management systemsiddiqui241993
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
 
Social harvesting - Webbots
Social harvesting - WebbotsSocial harvesting - Webbots
Social harvesting - WebbotsAvi Perez
 
The Future of Plugin Dev
The Future of Plugin DevThe Future of Plugin Dev
The Future of Plugin DevBrandon Kelly
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core ModuleKatie Gulley
 

Similar to A Groovy Way to Interface With Cascade Server (20)

Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
 
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in PracticeOpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
03 form-data
03 form-data03 form-data
03 form-data
 
Data herding
Data herdingData herding
Data herding
 
Data herding
Data herdingData herding
Data herding
 
JS Essence
JS EssenceJS Essence
JS Essence
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScript
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Break out of The Box - Part 2
Break out of The Box - Part 2Break out of The Box - Part 2
Break out of The Box - Part 2
 
How to use the new Domino Query Language
How to use the new Domino Query LanguageHow to use the new Domino Query Language
How to use the new Domino Query Language
 
Library management system
Library management systemLibrary management system
Library management system
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
Social harvesting - Webbots
Social harvesting - WebbotsSocial harvesting - Webbots
Social harvesting - Webbots
 
The Future of Plugin Dev
The Future of Plugin DevThe Future of Plugin Dev
The Future of Plugin Dev
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Questions On The Code And Core Module
Questions On The Code And Core ModuleQuestions On The Code And Core Module
Questions On The Code And Core Module
 

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
 
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
 
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
 

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
 
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
 
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...
 

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 

A Groovy Way to Interface With Cascade Server

  • 1. A Groovy Way to Interface With Cascade Server Creating a Phone Directory & Course Pages Tom Wilkinson Cuyahoga Community College
  • 2. This presentation is for you if • You have written programs in some procedural object oriented language • You have created Data Definitions and Velocity or XSLT formats in Cascade • You are familiar with Active Directory • You are familiar with Web Services • You need to develop interfaces to Cascade • You know or are willing to learn Groovy
  • 3. About Me • Worked at the Tri-C full time since 1974 • Worked in IT since 1980 • Worked with C# since 2005 • Worked with HTML, CSS and JavaScript since 2008 • Worked with Groovy since 2013 • Married with 3 adult children, 2 grandchildren and 3 dogs
  • 4. Agenda • About Cuyahoga Community College • About Our Project • Groovy • Phone Directory • Velocity • Workforce Training Course Pages • Structured Data Nodes • Questions
  • 5. About Cuyahoga Community College • First Community College in Ohio, opened in 1963 • 1,000 credit courses each semester • 600 non-credit courses are offered annually • 60,000 credit and non-credit students each year • 4 campus locations and 7 other sites
  • 7. About Cuyahoga Community College Student Profile • Average age is 29 years old • Student ages range from 15 to 75+ • 61% are women • 39% are from minority groups • 65% study part-time • 56% are seeking an associate degree or are taking courses to prepare for transfer to a four-year institution • 30% are focusing in areas related to health careers • 17% attend only evening or weekend classes • 67% are enrolled in technical job training courses • 17% are enrolled in business programs
  • 8. About Our Project Goals • Create one site to serve both mobile and desktop • Fast site with less pages, images and documents that are more timely and accurate • A CMS platform that is easy to maintain and update • A CMS that will allow us the flexibility to modify CSS, HTML and JavaScript quickly to meet Interactive Communications needs
  • 9. About Our Project Current Status • We plan to go live with the new site the third week of November 2014 • We had Cascade for 1.5 years but the project was delayed by non-technical reasons • Curent site has over 2,500 pages, over 6,200 documents and over 3,400 images
  • 10. Groovy Why? • PHP is forbidden by our Office of Safe and Secure Computing • Works with Cascade Web Services • Easy for C# developers to understand • Less verbose then Java • Can (practically) do anything Java can do • Banner XE uses Groovy
  • 11. Groovy Sample Code 1. package groovytest 2. import groovy.sql.Sql 3. class NewGroovyClass { 4. static main(args) { 5. def configFile = new File('config.groovy').toURI().toURL(); 6. def config = new ConfigSlurper().parse(configFile) 7. def sql = Sql.newInstance(config.sqlConnection) 8. sql.eachRow( 'select * from Status' ) { 9. println "$it.id -- ${it.Name}" 10. } 11. } 12. } config.groovy: sqlConnection = 'jdbc:jtds:sqlserver://testserver/Test_DB'
  • 13. Phone Directory Process Part 1 • Groovy application queries Active Directory for all staff that are not hidden • Reformats department names and locations • Creates XML document on an internal web server
  • 14. Phone Directory Process Part 2 • Cascade reads in XML feed block during page publishing and a velocity script converts it to JSON and imbeds it in the Phone Directory page • The published Phone Directory page is a Single Page Application (SPA) containing the search functionality
  • 15. Phone Directory Tool • Gradle 1.8 • IntelliJ IDEA 13.1 (or whatever you like) • Visual Studio 2013 for HTML, CSS and JavaScript (or whatever you like)
  • 16. Phone Directory Libraries • Groovy 2.3.3 • org.apache.directory.api 1.0.0-M24 • groovy-ldap • org.slf4j 1.7.7 • ch.qos.logback 1.1.2 • activation 1.0.2 • javax.mail 1.4.7 • Jquery 1.11 • Telerik Kendo UI (JavaScript Library)
  • 17. Groovy LDAP with Apache Directory LDAP API def ret = new ArrayList<Person>() def ldap = LDAP.newInstance(uri, user, password) ldap.eachEntry ("(&(objectclass=user)(objectcategory=person)(employeeNumber=*))") { person -> def p = new Person() p.department = DepartmentFilter(person.department) p.email = person.mail p.fax = person.facsimiletelephonenumber p.isFaculty = IsFaculty(person.memberof) p.location = MakeLocation(person.businesscategory, person.streetaddress) p.name = MakeName(person.sn, person.givenname, person.middlename, person.personaltitle) p.firstName = person.givenname p.lastName = person.sn p.phone = person.telephonenumber p.room = person.physicaldeliveryofficename p.title = person.title ret << p }
  • 18. Phone Directory Groovy Classes Class Name Description App Setups logging, deletes old logs files, reads configuration file, calls ADInterface to get user, calls XMLGenerater to output XML file ADInterface Get all unhidden employees, fixes department names and locations Person DTO from ADInterface to XMLGenerator XMLGenerator Creates XML file with person, department and location nodes DESCodec Decrypt AD users password from configuration file LogUtility Delete old log files
  • 19. Phone Directory Execution • Extracted 269 departments • Extracted 11 locations • Extracted 3847 people • Normal end took 1 minutes, 2.314 seconds
  • 21. Velocity Tips • Empty inner HTML is turn into an empty tag <a href=“#”></a>  <a href=“#”/> <a href=“#”> </a>  <a href=“#”></a> • #set will not work with nulls #set($x = ‘old value’) #set($x = function-that-return-null()) $x is still ‘old value’ • Must manually escape and “ before using $_EscapeTool.javascript for JSON
  • 22. Workforce Training Course Pages Overview
  • 23. Workforce Training Course Pages Process • Retrieve all workforce courses, sections and prerequisites • Update or Create corresponding course page • Remove any course pages not in the database
  • 24. Workforce Training Course Pages Tools • Maven 3.0.5 • Gradle 1.8 • IntelliJ IDEA 13.1 (or whatever you like)
  • 25. Workforce Training Course Pages Libraries • Cascade Web Service generated from WSDL • axis 1.4 • Jtds 1.3.1 • Jsoup 1.7.3 • Groovy 2.3.3 • org.slf4j 1.7.7 • ch.qos.logback 1.1.2 • activation 1.0.2 • javax.mail 1.4.7
  • 26. Workforce Training Course Pages Groovy Classes Class Description App Sets up logging, reads configuration file, deletes old log files, setup AdvantageInterface and CascadeInterface then calls BusinessLogic BusinessLogic Gets courses, sections and prerequisites using AdvantageInterface and updates course pages in Cascade using CascadeInterface, removes old course pages AdvantageInterface Uses SQL Queries to get Courses, sections and prerequisites Course DTO for courses Prerequisite DTO for prerequisites Section DTO for sections CascadeInterface Lists pages, reads, updates and copies pages LogUtility Delete old log files
  • 27. Workforce Training Course Pages Execution • Using 45 programs • Retrieved 518 courses • Retrieved 3422 sections • Retrieved 202 prerequisites • Created page course-7249 • Created 1 pages and updated 517 pages • Deleted 0 pages • Normal end took 32 minutes, 16.050 seconds
  • 28. StructuredDataNode Text 1. private static StructuredDataNode CreateNode(String name, String value) { 2. def node = new StructuredDataNode() 3. node.type = StructuredDataType 4. .fromValue(StructuredDataType._text) 5. node.identifier = name 6. node.text = value?.trim() ? value : null 7. return node 8. }
  • 29. StructuredDataNode Checkbox 1. private static StructuredDataNode CreateNodeOfCheckbox(String name, Boolean value) { 2. def final checkbox = '::CONTENT-XML-CHECKBOX::' 3. def node = new StructuredDataNode() 4. node.type = StructuredDataType.fromValue(StructuredDataType._text) 5. node.identifier = name 6. if (value) { 7. node.text = "${checkbox}Yes" 8. } else { 9. node.text = checkbox 10. } 11. return node 12. }
  • 30. StructuredDataNode HTML 1. private static StructuredDataNode CreateNodeHtml(String name, String value) { 2. def node = new StructuredDataNode() 3. node.type = StructuredDataType 4. .fromValue(StructuredDataType._text) 5. node.identifier = name 6. if (value?.trim()) { 7. node.text = Jsoup.clean(value, Whitelist.basic()) 8. } else { 9. node.text = null 10. } 11. return node 12. }
  • 31. StructuredDataNodes 1. data += CreateNodeOfDate('updated', course.updated) 2. for (Prerequisite p in course.prerequisites) { 3. def prerequisite = [] 4. prerequisite += CreateNodeOfInt('id', p.id) 5. prerequisite += CreateNode('code', p.code) 6. prerequisite += CreateNode('number', p.number) 7. prerequisite += CreateNode('name', p.name) 8. prerequisite += CreateNode('comment', p.comment) 9. data += CreateNodeOfNodes('prerequisites', CreateNodes(prerequisite.toList())) 10. }
  • 32. Resources Books • Groovy in Action by Dierk König, Guillaume Laforge, Paul King and Cédric Champeau • Programming Groovy 2: Dynamic Productivity for the Java Developer (Pragmatic Bookshelf) by Venkat Subramaniam • Velocity: The Basics: Scripting with a $ here and a # to do by James Johnson
  • 33. Resources Web • http://groovy.codehaus.org/ • http://directory.apache.org/api/groovy-ldap.html • http://www.gradle.org/ • http://www.jetbrains.com/idea/ • http://www.slf4j.org/ • http://logback.qos.ch/ • http://www.telerik.com/kendo-ui • http://jsoup.org/ • http://jtds.sourceforge.net/ • https://github.com/hannonhill/Webservices-Java- Sample-Project
  • 34. Questions • tom.wilkinson@tri-c.edu • (216) 987-3666 • Github: https://github.com/Tri-C