SlideShare a Scribd company logo
EXTENDING QUERIES & REPORTS WITH
JSON & JQUERY
Case Western Reserve University
Tools
JSON (JavaScript Object
Notation):
• open standard
alternative to XML
• name/value pairs
• http://json.org
jQuery:
• open source JavaScript
library
• client side
• http://jquery.com
Embedding Upcoming Events
In Slate
select getdate() as [@updated],
(select f.[category] as [folder], f.[date] as [dtstart], f.[dtend], f.[deadline],
coalesce(f.[summary], p.[summary]) as [title],
coalesce(f.[location], p.[location]) as [location],
coalesce(f.[street], p.[street]) as [street],
coalesce(f.[city], p.[city]) as [city],
coalesce(f.[region], p.[region]) as [region],
coalesce(f.[postal], p.[postal]) as [postal],
coalesce(f.[country], p.[country]) as [country],
(select [name] from [world].dbo.[country] where ([id] = coalesce(f.[country],
p.[country]))) as [countryName],
convert(varchar, coalesce(f.[geo], p.[geo]).Lat) as [lat],
convert(varchar, coalesce(f.[geo], p.[geo]).Long) as [lng],
(select [value] from [config] where ([key] = 'https')) + '/register/'
+ coalesce(f.[alias] + '/', '?id=' + dbo.toGuidString(f.[id])) as [url],
(select f.[description] as [node()] for xml path('')) as [description]
from [form] f
left outer join [form] p on (p.[id] = f.[parent])
where (f.[type] = 'event') and (f.[date] > getdate()) and (f.[category] = 'Campus
Visit') and (f.[summary] != 'Campus Tour and Information Session')
for xml path('event'), type)
for xml path('events'), type
Output
{"events":{"@updated":"2014-06-19T14:47:40.963","event":[{"folder":"Campus Visit","dtstart":"2014-06-27T09:00:00","dtend":"2014-06-
27T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid
Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-
81.6083","url":"https://go.case.edu/register/?id=7c2dcda2-7f40-4918-bcb6-97d60ef318ea","description":null},{"folder":"Campus Visit","dtstart":"2014-07-
11T09:00:00","dtend":"2014-07-11T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111
Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-
81.6083","url":"https://go.case.edu/register/?id=904b243a-7323-4f85-96df-3fe3babe15f9","description":null},{"folder":"Campus Visit","dtstart":"2014-07-
18T09:00:00","dtend":"2014-07-18T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111
Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-
81.6083","url":"https://go.case.edu/register/?id=fdf7e3f3-ba0a-4458-9d9d-203f21e9b95a","description":null},{"folder":"Campus Visit","dtstart":"2014-07-
25T09:00:00","dtend":"2014-07-25T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111
Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-
81.6083","url":"https://go.case.edu/register/?id=e29a3913-d467-40d1-bc4b-70b0d3b53487","description":null},{"folder":"Campus Visit","dtstart":"2014-
08-01T09:00:00","dtend":"2014-08-01T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve
University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United
States","lat":"41.5074","lng":"-81.6083","url":"https://go.case.edu/register/?id=01a05b75-2a0b-4b24-8514-
596ea3c5597d","description":null},{"folder":"Campus Visit","dtstart":"2014-08-08T09:00:00","dtend":"2014-08-08T12:00:00","title":"Campus Preview
Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-
1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-81.6083","url":"https://go.case.edu/register/?id=7b59f46a-7b15-4693-a7ed-
715f5657068a","description":null}]}}
<head>
…
<script
src="http://code.jquery.com/jquery-
1.9.1.js"></script>
…
</head>
In HTML
In HTML
<div class="sideContent">
<h4>Upcoming Events</h4>
<ul id="div-event-list"></ul>
<div class="calLink">
<p>&raquo; <a
href="/visit/eventcalendar.aspx"
>View full visit
calendar</a></p>
</div>
In HTML<script type="text/javascript">
$.getJSON('http://go.case.edu/manage/query/process?id=f7df9cdb-
022a-4346-a794-5c2ccb74626a&h=2352b7fd-52ea-3b19-d383-
3ab9b1e25809&output=json'+ '&callback=?', function(data) {
if (!data.events.event) {
$("#div-event-list").append("<p style='padding-
left:15px'><strong>We're working hard on scheduling our next
round of events on campus!</strong></p>");
} else {
if (data.events.event.length) {
// more than one
for (i=0; i<data.events.event.length; i++) {
$("#div-event-list").append("<li><strong>" +
dateFormat(data.events.event[i].dtstart, "mmmm d") +"</strong>
- <a href='" + data.events.event[i].url + "' target='_blank'>"
+ data.events.event[i].title + "</a></li>");}
} else {
// works for one
$.each([data.events.event], function () {
$("#div-event-list").append("<li><strong>" +
dateFormat(this.dtstart, "mmmm d") +"</strong> - <a href='" +
this.url + "' target='_blank'>" + this.title +
"</a></li>");});}}});
</script>
Updating Other LOB Software
In Slateselect p.[user],
/* Admitted Student Questions */
CASE
WHEN EXISTS(SELECT p.id
from [form.response] __r
inner join [form] __f on (__f.[id] = __r.[form])
inner join [person] p on (p.[id] = __r.[record])
where
(__f.[id] = '584465DF-AA36-4C2E-9481-D79E83221BB0') and (__r.[pending] = 0) and (__r.[active] = 1) and
(p.[user] = @cwrunetid)) THEN 1
ELSE 0
END AS 'SLAS',
...
/* Indians Game */
CASE
WHEN EXISTS(SELECT p.id
from [form.response] __r
inner join [form] __f on (__f.[id] = __r.[form])
inner join [person] p on (p.[id] = __r.[record])
where
(__f.[id] = 'F0DF5D33-A5AD-4CF3-95BC-FC0810F1F82D') and (__r.[pending] = 0) and (__r.[active] = 1) and
(p.[user] = @cwrunetid)) THEN 1
ELSE 0
END AS 'SLBB',
/* Final HS Transcript */
CASE
WHEN EXISTS( select p.[ref]
from [application] a
inner join [person] p on (p.[id] = a.[person])
where
((a.[id] IN (select a.[id] from [material] m inner join [application] a on (a.[person] = m.[record]) where
(m.[key] in ('ft')) and (m.[record] is not null) union all select [record] from [material] where ([key] in ('ft')) and
([record] is not null)))) and (p.[user] = @cwrunetid)) THEN 1
ELSE 0
END AS 'SLFT'
from [person] p
where (p.[user] = @cwrunetid)
for xml path('person'), type
Request:
https://go.case.edu/manage/query/process?id=219d4e7b-
3c8b-4413-b70d-86b65a0580b5&h=baf86e5d-8596-646e-
3fd6-e1b4984b2673&output=json&cwrunetid=cxh456
{"person":{"user":"cxh456","SLAS":"1","SLOR":"1","SLBB"
:"0","SLTB":"0","SLSV":"0","SLDC":"0","SLPF":"0","SLIW":
"1","SLIA":"1","SLAD":"Tastes","SLRI":"0","SLFT":"0"}}
Returns:
Questions?
Contact
Jonathan Wehner
Director of Recruitment and
Strategic Initiatives
jonathan.wehner@case.edu
@jonathanwehner
Bob McCullough
Director of Undergraduate
Admission
robert.mccullough@case.edu
@bobcwru

More Related Content

What's hot

MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
Caserta
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkTyler Brock
 
Aggregation in MongoDB
Aggregation in MongoDBAggregation in MongoDB
Aggregation in MongoDBKishor Parkhe
 
Jan Lehnardt Couch Db In A Real World Setting
Jan Lehnardt Couch Db In A Real World SettingJan Lehnardt Couch Db In A Real World Setting
Jan Lehnardt Couch Db In A Real World SettingGeorge Ang
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Henrik Ingo
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB
 
Aggregation Framework
Aggregation FrameworkAggregation Framework
Aggregation FrameworkMongoDB
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
Norberto Leite
 
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1
Anuj Jain
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...MongoDB
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
Jason Terpko
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolio
clmcglothen
 
Exploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny TongExploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny Tong
Future Insights
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky
Data Con LA
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipeline
zahid-mian
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB MongoDB
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
Joe Drumgoole
 
Air Quality in Taiwan 2013
Air Quality in Taiwan 2013 Air Quality in Taiwan 2013
Air Quality in Taiwan 2013
Kuang-Hao Cheng
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation
Amit Ghosh
 

What's hot (20)

MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
Aggregation in MongoDB
Aggregation in MongoDBAggregation in MongoDB
Aggregation in MongoDB
 
Jan Lehnardt Couch Db In A Real World Setting
Jan Lehnardt Couch Db In A Real World SettingJan Lehnardt Couch Db In A Real World Setting
Jan Lehnardt Couch Db In A Real World Setting
 
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop ConnectorAnalytics with MongoDB Aggregation Framework and Hadoop Connector
Analytics with MongoDB Aggregation Framework and Hadoop Connector
 
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation PipelinesMongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
MongoDB Europe 2016 - Advanced MongoDB Aggregation Pipelines
 
Aggregation Framework
Aggregation FrameworkAggregation Framework
Aggregation Framework
 
Aggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days MunichAggregation Framework MongoDB Days Munich
Aggregation Framework MongoDB Days Munich
 
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
MongoDB Analytics: Learn Aggregation by Example - Exploratory Analytics and V...
 
Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1Aggregation Framework in MongoDB Overview Part-1
Aggregation Framework in MongoDB Overview Part-1
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
MongoDB - Aggregation Pipeline
MongoDB - Aggregation PipelineMongoDB - Aggregation Pipeline
MongoDB - Aggregation Pipeline
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolio
 
Exploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny TongExploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny Tong
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipeline
 
Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB Data Processing and Aggregation with MongoDB
Data Processing and Aggregation with MongoDB
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
 
Air Quality in Taiwan 2013
Air Quality in Taiwan 2013 Air Quality in Taiwan 2013
Air Quality in Taiwan 2013
 
MongoDB Aggregation
MongoDB Aggregation MongoDB Aggregation
MongoDB Aggregation
 

Viewers also liked

Getting Started in the Mobile Web
Getting Started in the Mobile WebGetting Started in the Mobile Web
Getting Started in the Mobile WebBrian Fling
 
Python profiling
Python profilingPython profiling
Python profiling
dreampuf
 
Android App Development (Basics)
Android App Development (Basics)Android App Development (Basics)
Android App Development (Basics)
Alberto Rubalcaba Stockman
 
Search For Buzz Sc Bilbao 2010, Massimo Burgio
Search For Buzz Sc Bilbao 2010, Massimo BurgioSearch For Buzz Sc Bilbao 2010, Massimo Burgio
Search For Buzz Sc Bilbao 2010, Massimo Burgio
search congress
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
sachin9737
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkitLainZQ
 
Not my type font
Not my type fontNot my type font
Not my type font
Simon Stratford
 

Viewers also liked (7)

Getting Started in the Mobile Web
Getting Started in the Mobile WebGetting Started in the Mobile Web
Getting Started in the Mobile Web
 
Python profiling
Python profilingPython profiling
Python profiling
 
Android App Development (Basics)
Android App Development (Basics)Android App Development (Basics)
Android App Development (Basics)
 
Search For Buzz Sc Bilbao 2010, Massimo Burgio
Search For Buzz Sc Bilbao 2010, Massimo BurgioSearch For Buzz Sc Bilbao 2010, Massimo Burgio
Search For Buzz Sc Bilbao 2010, Massimo Burgio
 
Css Best Practices
Css Best PracticesCss Best Practices
Css Best Practices
 
这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit这年头,你只需要懂Node webkit
这年头,你只需要懂Node webkit
 
Not my type font
Not my type fontNot my type font
Not my type font
 

Similar to Extending Slate Queries & Reports with JSON & JQUERY

TDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
TDC2018SP | Trilha Java - Java SE 8 for Java EE DevelopersTDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
TDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
tdc-globalcode
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShellPesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
Daniel Bohannon
 
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent testsvfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
Frank Kleine
 
Books
BooksBooks
Books
flaglio
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsShoaib Burq
 
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin
 
Building Evented Single Page Applications
Building Evented Single Page ApplicationsBuilding Evented Single Page Applications
Building Evented Single Page Applications
Steve Smith
 
Building evented single page applications
Building evented single page applicationsBuilding evented single page applications
Building evented single page applications
Steve Smith
 
Server Side Events
Server Side EventsServer Side Events
Server Side Events
thepilif
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
Donny Wals
 
Yahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from InternetYahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from Internet
drgath
 
Using R for Building a Simple and Effective Dashboard
Using R for Building a Simple and Effective DashboardUsing R for Building a Simple and Effective Dashboard
Using R for Building a Simple and Effective Dashboard
Andrea Gigli
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
Andy McKay
 
Manipulating data with dates
Manipulating data with datesManipulating data with dates
Manipulating data with dates
Rupak Roy
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScript
Justin Deoliveira
 
Building Apps with SwiftUI and Firebase
Building Apps with SwiftUI and FirebaseBuilding Apps with SwiftUI and Firebase
Building Apps with SwiftUI and Firebase
Peter Friese
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPJeremy Kendall
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
Bastian Feder
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-futureyiming he
 

Similar to Extending Slate Queries & Reports with JSON & JQUERY (20)

TDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
TDC2018SP | Trilha Java - Java SE 8 for Java EE DevelopersTDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
TDC2018SP | Trilha Java - Java SE 8 for Java EE Developers
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShellPesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
PesterSec: Using Pester & ScriptAnalyzer to Detect Obfuscated PowerShell
 
vfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent testsvfsStream - a better approach for file system dependent tests
vfsStream - a better approach for file system dependent tests
 
Books
BooksBooks
Books
 
Async. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.jsAsync. and Realtime Geo Applications with Node.js
Async. and Realtime Geo Applications with Node.js
 
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"
 
Building Evented Single Page Applications
Building Evented Single Page ApplicationsBuilding Evented Single Page Applications
Building Evented Single Page Applications
 
Building evented single page applications
Building evented single page applicationsBuilding evented single page applications
Building evented single page applications
 
Server Side Events
Server Side EventsServer Side Events
Server Side Events
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
 
Yahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from InternetYahoo Query Language: Select * from Internet
Yahoo Query Language: Select * from Internet
 
Using R for Building a Simple and Effective Dashboard
Using R for Building a Simple and Effective DashboardUsing R for Building a Simple and Effective Dashboard
Using R for Building a Simple and Effective Dashboard
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Manipulating data with dates
Manipulating data with datesManipulating data with dates
Manipulating data with dates
 
Scripting GeoServer with GeoScript
Scripting GeoServer with GeoScriptScripting GeoServer with GeoScript
Scripting GeoServer with GeoScript
 
Building Apps with SwiftUI and Firebase
Building Apps with SwiftUI and FirebaseBuilding Apps with SwiftUI and Firebase
Building Apps with SwiftUI and Firebase
 
Leveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHPLeveraging the Power of Graph Databases in PHP
Leveraging the Power of Graph Databases in PHP
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-future
 

Recently uploaded

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 

Extending Slate Queries & Reports with JSON & JQUERY

  • 1. EXTENDING QUERIES & REPORTS WITH JSON & JQUERY Case Western Reserve University
  • 2. Tools JSON (JavaScript Object Notation): • open standard alternative to XML • name/value pairs • http://json.org jQuery: • open source JavaScript library • client side • http://jquery.com
  • 4. In Slate select getdate() as [@updated], (select f.[category] as [folder], f.[date] as [dtstart], f.[dtend], f.[deadline], coalesce(f.[summary], p.[summary]) as [title], coalesce(f.[location], p.[location]) as [location], coalesce(f.[street], p.[street]) as [street], coalesce(f.[city], p.[city]) as [city], coalesce(f.[region], p.[region]) as [region], coalesce(f.[postal], p.[postal]) as [postal], coalesce(f.[country], p.[country]) as [country], (select [name] from [world].dbo.[country] where ([id] = coalesce(f.[country], p.[country]))) as [countryName], convert(varchar, coalesce(f.[geo], p.[geo]).Lat) as [lat], convert(varchar, coalesce(f.[geo], p.[geo]).Long) as [lng], (select [value] from [config] where ([key] = 'https')) + '/register/' + coalesce(f.[alias] + '/', '?id=' + dbo.toGuidString(f.[id])) as [url], (select f.[description] as [node()] for xml path('')) as [description] from [form] f left outer join [form] p on (p.[id] = f.[parent]) where (f.[type] = 'event') and (f.[date] > getdate()) and (f.[category] = 'Campus Visit') and (f.[summary] != 'Campus Tour and Information Session') for xml path('event'), type) for xml path('events'), type
  • 5. Output {"events":{"@updated":"2014-06-19T14:47:40.963","event":[{"folder":"Campus Visit","dtstart":"2014-06-27T09:00:00","dtend":"2014-06- 27T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"- 81.6083","url":"https://go.case.edu/register/?id=7c2dcda2-7f40-4918-bcb6-97d60ef318ea","description":null},{"folder":"Campus Visit","dtstart":"2014-07- 11T09:00:00","dtend":"2014-07-11T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"- 81.6083","url":"https://go.case.edu/register/?id=904b243a-7323-4f85-96df-3fe3babe15f9","description":null},{"folder":"Campus Visit","dtstart":"2014-07- 18T09:00:00","dtend":"2014-07-18T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"- 81.6083","url":"https://go.case.edu/register/?id=fdf7e3f3-ba0a-4458-9d9d-203f21e9b95a","description":null},{"folder":"Campus Visit","dtstart":"2014-07- 25T09:00:00","dtend":"2014-07-25T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"- 81.6083","url":"https://go.case.edu/register/?id=e29a3913-d467-40d1-bc4b-70b0d3b53487","description":null},{"folder":"Campus Visit","dtstart":"2014- 08-01T09:00:00","dtend":"2014-08-01T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106-1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-81.6083","url":"https://go.case.edu/register/?id=01a05b75-2a0b-4b24-8514- 596ea3c5597d","description":null},{"folder":"Campus Visit","dtstart":"2014-08-08T09:00:00","dtend":"2014-08-08T12:00:00","title":"Campus Preview Day","location":"Thwing Center - Case Western Reserve University","street":"11111 Euclid Ave","city":"Cleveland","region":"OH","postal":"44106- 1715","country":"US","countryName":"United States","lat":"41.5074","lng":"-81.6083","url":"https://go.case.edu/register/?id=7b59f46a-7b15-4693-a7ed- 715f5657068a","description":null}]}}
  • 7. In HTML <div class="sideContent"> <h4>Upcoming Events</h4> <ul id="div-event-list"></ul> <div class="calLink"> <p>&raquo; <a href="/visit/eventcalendar.aspx" >View full visit calendar</a></p> </div>
  • 8. In HTML<script type="text/javascript"> $.getJSON('http://go.case.edu/manage/query/process?id=f7df9cdb- 022a-4346-a794-5c2ccb74626a&h=2352b7fd-52ea-3b19-d383- 3ab9b1e25809&output=json'+ '&callback=?', function(data) { if (!data.events.event) { $("#div-event-list").append("<p style='padding- left:15px'><strong>We're working hard on scheduling our next round of events on campus!</strong></p>"); } else { if (data.events.event.length) { // more than one for (i=0; i<data.events.event.length; i++) { $("#div-event-list").append("<li><strong>" + dateFormat(data.events.event[i].dtstart, "mmmm d") +"</strong> - <a href='" + data.events.event[i].url + "' target='_blank'>" + data.events.event[i].title + "</a></li>");} } else { // works for one $.each([data.events.event], function () { $("#div-event-list").append("<li><strong>" + dateFormat(this.dtstart, "mmmm d") +"</strong> - <a href='" + this.url + "' target='_blank'>" + this.title + "</a></li>");});}}}); </script>
  • 10. In Slateselect p.[user], /* Admitted Student Questions */ CASE WHEN EXISTS(SELECT p.id from [form.response] __r inner join [form] __f on (__f.[id] = __r.[form]) inner join [person] p on (p.[id] = __r.[record]) where (__f.[id] = '584465DF-AA36-4C2E-9481-D79E83221BB0') and (__r.[pending] = 0) and (__r.[active] = 1) and (p.[user] = @cwrunetid)) THEN 1 ELSE 0 END AS 'SLAS', ... /* Indians Game */ CASE WHEN EXISTS(SELECT p.id from [form.response] __r inner join [form] __f on (__f.[id] = __r.[form]) inner join [person] p on (p.[id] = __r.[record]) where (__f.[id] = 'F0DF5D33-A5AD-4CF3-95BC-FC0810F1F82D') and (__r.[pending] = 0) and (__r.[active] = 1) and (p.[user] = @cwrunetid)) THEN 1 ELSE 0 END AS 'SLBB', /* Final HS Transcript */ CASE WHEN EXISTS( select p.[ref] from [application] a inner join [person] p on (p.[id] = a.[person]) where ((a.[id] IN (select a.[id] from [material] m inner join [application] a on (a.[person] = m.[record]) where (m.[key] in ('ft')) and (m.[record] is not null) union all select [record] from [material] where ([key] in ('ft')) and ([record] is not null)))) and (p.[user] = @cwrunetid)) THEN 1 ELSE 0 END AS 'SLFT' from [person] p where (p.[user] = @cwrunetid) for xml path('person'), type
  • 13. Contact Jonathan Wehner Director of Recruitment and Strategic Initiatives jonathan.wehner@case.edu @jonathanwehner Bob McCullough Director of Undergraduate Admission robert.mccullough@case.edu @bobcwru

Editor's Notes

  1. Bob:
  2. Bob:
  3. Bob:
  4. Bob: