[Xerte-dev] Re: Xerte editor closes if you add a setup script to the Learning Object icon
Kemp Johnathan
johnathan.kemp at ntlworld.com
Sat Feb 25 21:12:46 GMT 2012
Hello Julian,
_level0.contentXML._url - this returns undefined
_level0.engine.contentXML._url or rootIcon.contentXM._url both return
file://C:Xerte2\XMLEngine.swf?id=77679910
(my install folder is C:\xerte2)
Kind regards
Johnathan
On 24 February 2012 10:20, Julian Tenney <Julian.Tenney at nottingham.ac.uk>wrote:
> Test this:
>
> _level0.contentXML._url
>
> It should be the url to the rlo / rlt file, with the extension on the end.
>
> -----Original Message-----
> From: Tenney Julian
> Sent: 24 February 2012 09:41
> To: 'For Xerte technical developers'
> Subject: RE: [Xerte-dev] Re: Xerte editor closes if you add a setup script
> to the Learning Object icon
>
> if (pageIcon.extXML != undefined){
> // Page Wizard
>
> Yes, I think that will work. In any case, any engine test could also be
> written in the template.rlt, it will only use the same information to judge
> the situation.
>
> Some usful thigns for testing environments:
>
> if the LO has template data...
> if a page has templateData...?
> if mdm != undefined you are at design time in xerte on windows
> if templatePath != undefined you are on a toolkits server else you're not.
>
> -----Original Message-----
> From: Tenney Julian
> Sent: 22 February 2012 13:47
> To: For Xerte technical developers
> Subject: RE: [Xerte-dev] Re: Xerte editor closes if you add a setup script
> to the Learning Object icon
>
> They don't at the moment, but I think you need an engine-side test. I'll
> write something for you.
> ________________________________________
> From: xerte-dev-bounces at lists.nottingham.ac.uk [
> xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan [
> johnathan.kemp at ntlworld.com]
> Sent: 22 February 2012 07:18
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: Xerte editor closes if you add a setup script to
> the Learning Object icon
>
> Would it ever be the case that a XOT project would assign a value to a
> page Icon's templateData property?
>
> If this would never happen then I can just reverse the original test,
> instead of testing for a project extXML I can test for pageIcon.extXML
>
> if (pageIcon.extXML != undefined){
> // Page Wizard
>
> What do you think?
>
> Kind regards
>
> Johnathan
>
> On 21 February 2012 16:54, Julian Tenney <Julian.Tenney at nottingham.ac.uk
> <mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
> Maybe you can check the value of the templateData attribute on LO icon? If
> undefined, it must be page wizards... otherwise irs either XOT or a
> desktop template project.
>
> From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
> Sent: 21 February 2012 16:53
>
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: Xerte editor closes if you add a setup script to
> the Learning Object icon
>
> Neither am I.
>
> I was going to ask you if you had any ideas where I would be able to
> access it.
>
> Is the project file in a XOT project always called template? as in
> template.rlt.
>
> It might be easier to check the file name rather than the extension as
> this will be available in templateData.
>
> Kind regards
>
> Johnathan
>
> On 21 February 2012 14:38, Julian Tenney <Julian.Tenney at nottingham.ac.uk
> <mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
> Not sure how you get it mind.
>
> From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
> Sent: 21 February 2012 14:38
>
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: Xerte editor closes if you add a setup script to
> the Learning Object icon
>
> Sounds do-able, i'll have a go.
>
> JK
>
> On 21 February 2012 13:16, Julian Tenney <Julian.Tenney at nottingham.ac.uk
> <mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
> Could you work on the filename, so if rlt else pageTemplates?
>
> From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
> Sent: 21 February 2012 12:52
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: Xerte editor closes if you add a setup script to
> the Learning Object icon
>
> Hello Julian,
>
> Thanks for a quick fix - all tests so far suggest this has solved the
> problem :-)
>
> Now that I am working on a default .rlo file for the "page projects" I am
> including a template and xwd file which is resulting in there being an
> extXML, it also means that now the project can take the project name from
> the extXML file just as with pageTemplates / XOT.
>
> So I need a new test for identifying when the model is in XOT /
> pageTemplate projects and when it is in a desktop project.
>
> What I would like to do is work on the principle that in XOT /
> pageTemplate projects the setup script will define a variable "xMode"
>
> Then I can replace the original block
>
> if (extXML == undefined){
> // 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();
> rootIcon.setTitleText(templateData.learningObject[0].name);
> }
>
> with
>
> if (xMode == undefined){
> // Page Wizard
> pageIcon.templateData = pageIcon.extXML.firstChild.toObject();
> // pageIcon.templateData = pageIcon.templateData.pageWizard[0];
> } else {
> // Toolkits
> myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() -
> pgOffset]);
> pageIcon.templateData = myXML.toObject();
> // rootIcon.setTitleText(templateData.learningObject[0].name);
> }
> rootIcon.setTitleText(templateData.learningObject[0].name);
>
> The commented lines of code would be removed - they are just there to make
> explicit the changes I am proposing.
>
> Not requiring to define a value for xMode in a desktop environment would
> make it easier to use the models in a pure desktop project (i.e. one in
> which the developer did not even use the "Create new Page Project option"),
> but it would need that all XOT projects and future pageTemplate projects
> had the xMode variable set.
>
> What do you think?
>
> Given that the line
> rootIcon.setTitleText(templateData.learningObject[0].name);
>
> works, would it also mean that if we had a method for the page icon to set
> it's title property that we could use
>
> pageIcon.setTitleText(pageIcon.templateData.pageType[0].name);
>
> As a way of overcoming the problem of using the name value to set up the
> page title display (probably wouldn't sort out the display of page titles
> in the TOC though) mmm.
>
> Kind regards
>
> Johnathan
>
>
> On 21 February 2012 11:25, Julian Tenney <Julian.Tenney at nottingham.ac.uk
> <mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
> Try this one please.
>
> From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk<mailto:
> xerte-dev-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan
> Sent: 20 February 2012 22:51
> To: Xerte Developers Discussion List
> Subject: [Xerte-dev] Xerte editor closes if you add a setup script to the
> Learning Object icon
>
> I've been doing some tests as part of establishing a standard
> pagetemplate.rlo file for the new version of the xerte editor that handles
> individual page templates..
>
> However I have hit a problem. I want to include one or more set up scripts
> as children of the Learning Object.
>
> If you add a setup script then this breaks the process of adding a new
> page. The folder for the page is created in the "pages" folder and the xwd
> and xml files are created in the page's folder. However the insertion of
> the page model file into the project fails. This means that if you select
> "Yes" when the "Open the wizard" prompt is displayed then Xerte collapses
> to the task bar and won't open again.
>
> If you then close down Xerte and then re-open the project the project
> behaves correctly until you try adding another page.
>
> Kind regards
>
> Johnathan
>
>
> 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-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> 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-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> 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-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> 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-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
> 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-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20120225/9d18c5c2/attachment-0001.html>
More information about the Xerte-dev
mailing list