[Xerte] Re: Creating new template question
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Thu Sep 6 11:19:57 BST 2012
We live in interesting times...
From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan
Sent: 06 September 2012 10:27
To: Xerte discussion list
Subject: [Xerte] Re: Creating new template question
It seems ironic that we have just got to the point where Xerte and XOT use the same model and xwd files, and new pages developed in Xerte can be easily ported over to XOT at the same time as external factors are forcing the move of XOT to HTML5.
October should be very interesting.
Kind regards
Johnathan
On 6 September 2012 08:33, Julian Tenney <Julian.Tenney at nottingham.ac.uk<mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
>It is certainly worth someone looking at it
It might well be, but thinking ahead to an HTML5 world, I can see us de-coupling XOT from Xerte, which would make it moot. We need to talk about this in October.
From: xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk> [mailto:xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
Sent: 03 September 2012 12:45
To: Xerte discussion list
Subject: [Xerte] Re: Creating new template question
It is certainly worth someone looking at it. I am not trying to be unhelpful here but I am not well up on the "under the bonnet" stuff.
If there is a way of setting things up so that a simple function call sets up pageIcon.templateData appropriate to the environment it is in (perhaps by checking the project file extension i.e. rlt or not rlt.) then this would simplify the models and might remove the need for additional flags in set up scripts of entry frames or adding project properties.
However some of the pages e.g. the menu connector page have additional code in this section of the model that needs to be different depending on whether the page is in a pageTemplates / XOT environment or a Xerte environment and this would need to be handled in some way. So some pages might still need to begin with a block of code that could test the environment and then set things up accordingly. Ideally this test would be against a flag or indicator variable that had been set up automatically.
Perhaps this automated setup could also trigger the the updating of the page icon's name and title properties when the xwd title is changed. Currently this is set to happen by adding the "pages = true" property to the learning object icon.
This would make everything more automated.
With respect to automation I have done some checking with regard to the minimum needed to get a page model working in a standard Xerte project.
The bare minimum at present is to copy the common folder into the project folder, all other folders are already created automatically when needed (pages, media)
Then a new property "pages" needs adding to the learning object with a value of true, and an entry frame needs adding with a single script containing the line
rootIcon.projMode = "dev";
This will provide enough to get the individual page templates working. However page specific features that depend on the availability of additional code such as narration, will not function. To have full functionality of all pages then using a "pages" project would be recommended.
Kind regards
Johnathan
On 31 August 2012 09:20, Julian Tenney <Julian.Tenney at nottingham.ac.uk<mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
It would be much better to have this:
pageIcon = icon.parentNode.clip();
if (rootIcon.projMode == "dev"){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
} else {
// Toolkits
myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);
pageIcon.templateData = myXML.toObject();
}
put somewhere in the engine, and to have the model initialise itself with some sort of all to a function, maybe initModel(). Then the function can handle the specifics, and users don't need to see code that doesn't concern them, and we don't have duplicate code in every model file. We have discussed this before, I recall some challenges in trying to make it work. Worth looking at again?
From: xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk> [mailto:xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
Sent: 30 August 2012 21:31
To: Xerte discussion list
Subject: [Xerte] Re: Creating new template question
Hello Dave,
Sorry for the confusion.
The Page Wizards were never part of the official Xerte download. They were produced as a separate zip file that when unzipped created a set of folders, each of which contained several .xcp files. Each single .xcp file defined the xwd, rlm and xml file for a page. It is this separate add on to Xerte that has been retired.
The new Xerte 2.18 includes for each page type a separate xwd that defines the form, and an rlm file that defines the model for each page. Look in
Xerte \ pages \ models
\ wizards \ en-GB
to find them.
Each of the pages in the original page wizards download had its own xml file that was already populated with data. Its data was enclosed in
<learningObject> </learningObject> tags
so the top level node that existed when Xerte converted the xml to an object was "learningObject"
All the pages in Xerte 2.18 generate xml with their data enclosed in <pageWizard> tags so the top level node in the object is "pageWizard"
It really doesn't matter what the top level node is called as long as you are consistent. I think when we moved to implement the individual page templates in Xerte 2.18 I changed from using "learningObject" as that is what is used in pageTemplates xml files as a wrapper to contain the data for a whole Xerte project and not just for one page.
The important thing to realise is that in a pageTemplates (project wide template ) project or a XOT project there is only a single xml file that contains the data for all of the pages. Whereas in a Xerte pages project each page has its own xml data file (apologies if I am teaching you to suck eggs :-)
Since the intention is to create a model file that can be used in either Xerte or XOT this raises a problem since the structure of the xml file differs between the single page for Xerte individual page and the one file containing the data for all the pages in a XOT or pageTemplates type of project.
The opening section of the rlm file
pageIcon = icon.parentNode.clip();
if (rootIcon.projMode == "dev"){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
} else {
// Toolkits
myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);
pageIcon.templateData = myXML.toObject();
}
resolves this and the line highlighted in yellow effectively strips out the reference to pageWizard so that the rest of the model file can refer to pageIcon.templateData and thus be identical for both environments.
The original Page Wizard files were only designed to work in the desktop Xerte individual page environment so this was not an issue at the time.
What is now significant is that Tom has written some php code that will parse through all the xwd files in a xerte install to generate a new template.xwd file that can be used in XOT. Remember XOT does not use individual xwd files but instead uses a single file containing the forms for all the pages. I think this parser looks for the <wizard> and <pageWizard> tags that are contained in the individual xwd files to help identify the relevant sections to include when building the template.xwd file.
You can develop new pages by creating a project using File / New
However if you do so and then try using any of the existing model files you will run into a number of issues such as missing swf files, rootIcon.projMode will not be defined and some supporting code that is shared by several of the models e.g. narration support will not exist in your project.
Alternatively if you start your project using Pages / Create New Page Project then all the items needed to support the models will be included in your project. So it kind of makes sense to use the Page Project option and then to create a new page by starting from an existing one. If you pick a page that has some of the features you want in your page you can add extra fields to the xwd form run the form and examine the xml file to see that it is being populated correctly. Then you can modify the page's structure to consume the new data.
By keeping to the standard structures used in the new pages you will ensure that your new pages can be transferred to XOT if you wish to do that.
I hope that is a bit clearer.
KInd regards
Johnathan
On 30 August 2012 18:59, Dave Burnett <d_b_burnett at hotmail.com<mailto:d_b_burnett at hotmail.com>> wrote:
Thanks Johnathan.
I just opened a new file in Xerte and then inserted the drag/drop .rlm I am trying to alter.
so I added the templateData path in the LO and then used just
pageIcon.templateData = extXML.toObject();
pageIcon.templateData = pageIcon.templateData.learningObject[0];
to get the data loaded.
Why am I using learningObject and you are using pageWizard
I thought you had deprecated pageWizard.
________________________________
Date: Thu, 30 Aug 2012 18:25:56 +0100
From: johnathan.kemp at ntlworld.com<mailto:johnathan.kemp at ntlworld.com>
To: xerte at lists.nottingham.ac.uk<mailto:xerte at lists.nottingham.ac.uk>
Subject: [Xerte] Re: Creating new template question
You are using an old model file probably from a page wizard.
The new model files use
pageIcon = icon.parentNode.clip();
if (rootIcon.projMode == "dev"){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
} else {
// Toolkits
myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);
pageIcon.templateData = myXML.toObject();
}
A setup script off the entryFrame of a "pages" type project sets
rootIcon.projMode = "dev";
This ensures the model file behaves correctly for a desktop Xerte project. This value is not set in XOT projects which enables the same model file to be used in both Xerte and XOT. The idea being that people will be able to develop new page types in Xerte and then transfer them to a XOT environment.
Refer back to my other reply for an idea of how I approach the creation of a new page. Even if you don't follow the same steps it should guide you as to what else you need to do.
Kind regards
Johnathan
On 30 August 2012 15:42, Dave Burnett <d_b_burnett at hotmail.com<mailto:d_b_burnett at hotmail.com>> wrote:
I'm playing with the new 2.18 version (Thanks to Johnathan and all!).
I've made a new template and can load it onto the flowline.
Now I want to alter the underlying model and to do that I need to get test data into it.
So I open a new file and insert the .rlm from the models file.
In the first script icon of the .rlm we have:
if (extXML == undefined){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
Am I missing something, e.g. if extXML is undefined, won't pageIcon.extXML also be undefined?
What I need to do obviously is get data into pageIcon.templateData in order to get the model to function.
Cheers,
Dave
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.
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
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.
_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk> http://lists.nottingham.ac.uk/mailman/listinfo/xerte 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.
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
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.
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
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.
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20120906/eb149066/attachment-0001.html>
More information about the Xerte
mailing list