[Xerte-dev] Re: A little help digging into Xerte's internals?

Smith, John J.J.Smith at gcu.ac.uk
Fri May 8 23:40:57 BST 2015


Hi Brad,

See below.

John

Sent from Samsung tablet

Please send all enquiries to our shared Blended Learning inbox at hlsblt at gcu.ac.uk and one of the Learning Technologists will respond.



-------- Original message --------
From: "Smith, Bradley" <brsmith at akamai.com>
Date: 08/05/2015 23:18 (GMT+00:00)
To: For Xerte technical developers <xerte-dev at lists.nottingham.ac.uk>
Subject: [Xerte-dev] A little help digging into Xerte's internals?


I’ve noticed that, at least for me, the “Video Width” and “Video Height” properties on video pages don’t seem to have any effect. I’d like to learn more about Xerte’s internals and help out by troubleshooting this, so I’ve been digging around, but I’ve hit some walls and only have so much time I can spend on the issue (which unfortunately is making the video page pretty much unusable for me).

So, in light of the recent thread about how handy it would be to have more some more detailed references re how XOT content is built, how about I write up what I’ve figured out, and then hopefully someone more knowledgable can help me fill in the missing pieces?


 1.  A template page like `modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd` defines the properties you see in the `edithtml.php`
    *   …but the field definitions in here don’t look like they’re intended for human consumption, so maybe they come from somewhere else? like `src/Nottingham/wizards/en-GB/textVideo.xwd`? If so, I haven’t been able to make changes in the latter show up in the former… the latter are the individual page model wizard files. These are not used by the wizard but are combined to produce the data.xwd file that the wizard/editor loads
 2.  When you save content in the editor, it is written to `USER-FILES/$ID-$USER-$TEMPLATE/preview.xml`, which is read by `show_preview_code()` in `modules/xerte/preview.php` when you click Play.
    *   side-note: it looks like XOT saves the last ten versions as `preview.xml.1`, `preview.xml.2`, which would suggest some kind of revision control feature, which is cool but I’ve seen no evidence of such a thing. What’s going on there? Not sure. Probably something Tom added while working on the new editor. Its either a new feature or for testing the data integrity while saving
 3.  `show_preview_code()` calls show_template_page() in play.php. Assuming you’re rendering as html5, this loads `modules/xerte/player_html5/rloObject.htm`
    *   A fun fact I picked up here: you can append “&page=X” to the url to link directly to page X of the LO. Nice! You can also use PageID= and LinkID= which are less likely to be changed (such as by adding/moving pages)
 4.  At this point most of the heavy lifting seems to be handled by `modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js`
 5.  This does an AJAX call to retrieve USER-FILES/$ID-$USER-$TEMPLATE/preview.xml?time=$UNIX_TIMESTAMP
    *   First, why would you pass a url argument to a request for a static file? Is there something more going on here? There are some .htaccess files scattered about, but they don’t look like they do anything related to this, and yet...  The timestamp parameter to to ensure the file is downloaded from server and not losded from cache
    *   The xml just describes the structure of the LO, and has "<![CDATA[ Enter text for the page here ]]>” where all the content should be, so it must be being replaced by something…
 6.  …and at this point I’ve spent more time than I can justify today digging around trying to get to the bottom of this problem. Unfortunately I still haven’t answered question I really need to answer here: where the heck does the actual page content come from? The LO data comes from the xml file you mention above. It is loaded and parsed, page by page, by xenith.js and the page data is made available to the page models as they are loaded to be used for the first time.
    *   A model file like `modules/xerte/parent_templates/Nottingham/models_html5/textVideo.html` seems like it has to be involved, since it appears to define the code that actually displays a given page type, but when I make changes in this file they don’t seem to be reflected in what gets rendered.

I feel like I’ve gotta be close to the end of this trail (at least, I dearly hope I am…), but I just don’t have any more time to spend on this. Could one of the devs help me out? Then maybe this could be turned into a sort of architecture overview on the github wiki to help other new folks in the future.

Thanks!
—Brad



This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.


Glasgow Caledonian University is a registered Scottish charity, number SC021474


More information about the Xerte-dev mailing list