Just hours away from the first events of the User Conference and XQuery geeks all over are sharpening their MacBooks, testing out iPad integrations and, if you are like me, polishing up some XQuery code to show everyone that gotta have it feature.
Highlights from the show include great customer talks about XQuery powered applications from Royal Society of Chemistry, JetBlue, Yell, Bowker and more.
And there is plenty of XQuery (and XSLT) geeking out with:
- Darin McBeath's (Elsevier) session on building all XQuery applications
- How XML and XQuery can do Semantic and Linked Data queries with MarkLogic's Jason Monberg and Michael Blakeley
- The 'super' session (is it a Bird etc) on the MarkLogic App server by Justin Makeig of MarkLogic and Mindie Sorenson and Ryan Semerau, LDS
There will also be a reprise of my favorite customer session ever, the McGraw-Hill Create's Nimble Elephant session. This open discussion about creating and executing an innovative project wowed 'em at the Digital Publishing Summit in December and Shannon and crew are back again for the user conference.
Besides the sessions there are good times to be had, including a conference wide party at the California Academy of Sciences . . . and of course the Demo Jam tonight - sponsored by Avalon Consulting (thank you Avalon!)
This brings me to my XQuery I'm working on. Demo Jam is an event that I started to let developers show what they've been working on. The format is simple: you have 5 minutes to show your demo. At the end of the demos, each person's name and demo title is read and we take a decibel meter reading to select the winner (that would be the one with loudest crowd noise ).
To make things fair I've tried to keep the order picking random, using names in a hat or some quick XQuery hacking like this:
for $pres in ("presenter1", "presenter2", "etc")
order by xdmp:random()
return
$pres
But since this Demo Jam is for our customers and partners and has some real XML and XQuery gurus (see the full list here), I thought it would be fun to pick the order AND open it up in PowerPoint . . . all with XQuery.
First I loaded a blank Demo Jam contestant list into the MarkLogic Server and let it do the Office OpenXML conversion.
Then I run this XQuery to edit the slide, putting my new order into it:
declare namespace a="http://schemas.openxmlformats.org/drawingml/2006/main";
declare namespace p="http://schemas.openxmlformats.org/presentationml/2006/main";
let $presenters := ("presenter1","presenter2", "etc")
let $node := doc("/demojam/demo-list_pptx_parts/ppt/slides/slide1.xml")//p:txBody
let $new-node := let $line-up := let $order := for $pres in $presenters
order by xdmp:random()
return
$pres
for $presenter at $number in $order
return
(: Make the Bullet for each presenter :)
<a:p><a:pPr marL="457200" indent="-457200">
<a:lnSpc><a:spcPct val="170000"/></a:lnSpc>
<a:buAutoNum type="arabicPeriod"/></a:pPr>
<a:r><a:rPr lang="en-US" sz="2000" dirty="0" err="1" smtClean="0">
<a:latin typeface="Lucida Sans"/><a:cs typeface="Lucida Sans"/>
</a:rPr><a:t>{$presenter}</a:t>
</a:r><a:endParaRPr lang="en-US" sz="2000" dirty="0" smtClean="0"><a:latin typeface="Lucida Sans"/><a:cs typeface="Lucida Sans"/>
</a:endParaRPr>
</a:p>
return
(: write out the header as well :)
<p:txBody><a:bodyPr/><a:lstStyle/>
<a:p><a:pPr><a:lnSpc>
<a:spcPct val="170000"/></a:lnSpc>
<a:buFont typeface="Arial" pitchFamily="-108" charset="0"/><a:buNone/></a:pPr>
<a:r><a:rPr lang="en-US" dirty="0" smtClean="0">
<a:latin typeface="Lucida Sans"/><a:cs typeface="Lucida Sans"/>
</a:rPr>
<a:t>2010 User Conference Demo Jam</a:t></a:r>
</a:p><a:p><a:pPr>
<a:lnSpc><a:spcPct val="170000"/>
</a:lnSpc><a:buNone/>
</a:pPr><a:r><a:rPr lang="en-US" sz="2000" dirty="0" smtClean="0">
<a:latin typeface="Lucida Sans"/><a:cs typeface="Lucida Sans"/>
</a:rPr>
<a:t>Line Up</a:t></a:r></a:p>
{$line-up}
</p:txBody>
return
(: put all that back into slide1.xml :)
xdmp:node-replace($node, $new-node)
Then I use the handy tools from the MarkLogic Toolkit for PowerPoint to put it all together and return open it up in Excel:
xquery version "1.0-ml";
import module namespace ppt= "http://marklogic.com/openxml/powerpoint" at "/MarkLogic/openxml/presentation-ml-support.xqy";
xdmp:set-response-content-type("application/powerpoint"),
let $presentation-dir:="/demojam/demo-list_pptx_parts/"
let $map := ppt:package-map($presentation-dir)
return
ppt:package-map-zip($map)
If this doesn't all work live tonight at Demo Jam, maybe I'll check out the Microsoft Office session Pete Aven, MarkLogic and Jeffery Brown, LDS are putting on for some pointers.
See you there (in just a couple of hours!),
Matt
Comments