The stats of success

23 02 2010

Some time ago I posted about the eStudyGuide website I set up to match our InDesign study guide process. To explain it again, briefly, the XML from our InDesign TOCs get’s uploaded to a webserver along with the PDFs – the webpage reads the XML files and renders a download page for the course you’re looking for.

Well!  Anyway!  Term has started finally and this is the first semester that I’ve had the pages also hooked in to Google Analytics. I had this weird moment of doubt at some point, that the eStudyGuides weren’t really being used, and that we’d not really contributed anything of use to the University.  Not sure why on earth I thought that.  The stats for the first couple of weeks of Term prove how useful it is.

  • Over 4000 page views already
  • Over 1300 hits already
  • Over 5.5 minutes average on each page

eStudyGuide stats

I love Google Analytics, it’s damn awesome.  I’m looking forward to seeing the trends from now on, how each term differs from the next.

Overall, the InDesign XML features have really proved essential in all of this.  There are some glitches though that I believe I’ve never mentioned.  Some times carriage returns get tagged in the TOC when you map styles to tags – which means you get an empty XML tag in your XML document.

You’ll need error checking to make sure you’re not rendering that empty tag as anything on your website, especially if the count of XML tags matches a document count like the eStudyGuide set up.

I wonder though, would it be worth doing an XML Schema and having InDesign validate it’s output with the schema when we export our TOC XML?

The whole process, exporting the XML and PDFs, and then uploading the files is a bit labourious too, and mistakes happen.  With a bit of perl/php mastery, one of the more technical sauvy guys in our team has done some brilliant reporting around the setup, as well as a script that handles that uploading – a must have.  It checks document counts with the XML tags to make sure they match, checks for typos even, missing files, and more.  Many thanks to Damo for his help.

Onwards and upwards, I wonder what the next lot of improvements to the eSGs could be 🙂

Web front end for InDesign docs

5 11 2009

Well well.. I’ve been out of touch with the InDesign stuff I was really getting in to last year.  Other projects, as well as the restructure and fallout from that.  I did however pick things up a little just recently, and finished making a first draft front end to display the Study Guides from InDesign.

As you may/may not know, part of our InDesign process with the study guides allows us to export XML from the Table Of Contents (TOC).  This is a great spot to get some really usable data about the document, for instance, how many chapters and what are the chapter titles!

After creating the PDFs, and exporting the XML from the TOC, we simply dump it all on a web server.  I made a nice little PHP page that takes requests and displays an interface for students to download those PDFs – the PHP reads the requested course’s XML file, creates the list with the chapter titles and so on.

Why’d I bother doing this?  A couple of reasons really… Well okay a few:

  • Its fun.
  • It saves academics time by setting up a page for them where students can download the chapterised PDFs for their Study Guide.
  • It also saves the academic the time of splitting their whole document PDFs up in to chapter PDFs, because we do it.

It works well for us really, I mean, all we do is export the goods and throw it on a server, it couldn’t be more simple.  The outcome is really quite nice.  Next challenge will be how to integrate this more with the new LMS, Moodle.

e Study Guide Page

This is the end result, the web front end for the InDesign XML & PDFs

In terms of the web front end, it was quite easy with PHP to read the XML.  I didn’t need to do anything fancy at all, I suppose it is pretty simple XML.  In fact, I used the simpleXML php module.

By parsing in the courseID as a variable in the URL, the page loads the requested XML file

//capture courseID from URL

//load the xml that contains the info on the documents
$pathExt = ".xml";
$docInfoPath = $courseID . "/eStudyGuide/" . $courseID . $pathExt;
$docInfoXML = simplexml_load_file($docInfoPath);
$docTitles = array();

Then looping through to display the docs was easy as this!

$i = 1;

foreach ($docInfoXML->TOClev1 as $docTitles) {
	if (strlen($docTitles)!=3) {
		echo "<li>
			<a href='" . $courseID . "/eStudyGuide/" . $courseID . "_" . $i . ".pdf'>" . str_replace('    ', ":  pg", $docTitles) . "</a></li>";                            

Import XML into InDesign CS3

9 05 2008

The scenario:

We have 100 odd study guides, each require the creation of an overprint PDF containing course and faculty information, as well as a barcode and item number. The overprints are printed onto an already produced cover. It saves time, money and makes sense for us really.

The problem associated with that is, no one really has time to manually create 100 pages in InDesign, and copy and paste course information and barcode information from a number of sources, yuk! Even if we did have time, I don’t like the changes or stuffing up one of the barcodes, since you can’t even read what you’ve typed or pasted in.

The solution:

Pull the course, faculty and barcode information from a Database; create a simple XML file, and import into InDesign!

How the process went:

From what I’d read on the net, I assumed that when one imports XML into InDesign, all your pages are automatically created.  Maybe I missed something but I found that I had to actually create the pages manually, which isn’t really a problem as it’s only a few mouse clicks.

The next subtle thing I found which seemed to be missing from all of the instructions and tips I read on the net, was that the pages didn’t actually take on the tagged structure of their master page!  Okay, that was easy, all I had to do was tell the pages to Over-ride their master; and once I’d done that, DELETE the content of the master page (or else the imported xml goes in to the master page as well as your normal pages).

Despite everything looking perfect the XML wouldn’t import correctly; I ended up having some data missing on a page, then it’d be on the next page; basically stuff was all over the place.  

I found out, after going around in circles for ages; that when I’d told my pages to over-ride the master page – they didn’t take on the XML structure exactly as it was on the master!!!!  They all had their tags in the wrong bloody order!

So then all I did was just adjust the order of tags in my XML source, it still made sense so that was fine with me. 

Once I’d done that.. it worked perfectly!  XML in to InDesign does work, it’s just a little bit annoying sometimes!