<div>Neither am I.<br></div><div><br></div><div>I was going to ask you if you had any ideas where I would be able to access it.</div><div><br></div><div>Is the project file in a XOT project always called template? as in template.rlt.</div>
<div><br></div><div>It might be easier to check the file name rather than the extension as this will be available in templateData.</div><div><br></div><div>Kind regards</div><div><br></div><div>Johnathan</div><br><div class="gmail_quote">
On 21 February 2012 14:38, Julian Tenney <span dir="ltr"><<a href="mailto:Julian.Tenney@nottingham.ac.uk">Julian.Tenney@nottingham.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Not sure how you get it mind.</span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="margin-left:36.0pt">
<b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a> [mailto:<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Kemp Johnathan<br>
<b>Sent:</b> 21 February 2012 14:38</span></p><div><div class="h5"><br><b>To:</b> For Xerte technical developers<br><b>Subject:</b> [Xerte-dev] Re: Xerte editor closes if you add a setup script to the Learning Object icon</div>
</div></div><div><div class="h5"><p class="MsoNormal" style="margin-left:36.0pt"> </p><div><p class="MsoNormal" style="margin-left:36.0pt">Sounds do-able, i'll have a go.</p></div><div><p class="MsoNormal" style="margin-left:36.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:36.0pt">JK</p></div><p class="MsoNormal" style="margin-left:36.0pt"> </p><div><p class="MsoNormal" style="margin-left:36.0pt">On 21 February 2012 13:16, Julian Tenney <<a href="mailto:Julian.Tenney@nottingham.ac.uk" target="_blank">Julian.Tenney@nottingham.ac.uk</a>> wrote:</p>
<div><div><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Could you work on the filename, so if rlt else pageTemplates?</span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:72.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a> [mailto:<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Kemp Johnathan<br>
<b>Sent:</b> 21 February 2012 12:52<br><b>To:</b> For Xerte technical developers<br><b>Subject:</b> [Xerte-dev] Re: Xerte editor closes if you add a setup script to the Learning Object icon</span></p></div><div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p><div><p class="MsoNormal" style="margin-left:72.0pt">Hello Julian,</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">Thanks for a quick fix - all tests so far suggest this has solved the problem :-)</p>
</div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">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.</p>
</div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">So I need a new test for identifying when the model is in XOT / pageTemplate projects and when it is in a desktop project.</p>
</div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">What I would like to do is work on the principle that in XOT / pageTemplate projects the setup script will define a variable "xMode"</p>
</div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">Then I can replace the original block</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">if (extXML == undefined){<br> // Page Wizard<br> pageIcon.templateData = pageIcon.extXML.toObject();<br> pageIcon.templateData = pageIcon.templateData.pageWizard[0];<br>
} else {<br> // Toolkits<br> myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);<br> pageIcon.templateData = myXML.toObject();<br> rootIcon.setTitleText(templateData.learningObject[0].name);<br>
}</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">with</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
if (xMode == undefined){<br> // Page Wizard<br> pageIcon.templateData = pageIcon.extXML.firstChild.toObject();<br> // pageIcon.templateData = pageIcon.templateData.pageWizard[0];<br>} else {<br> // Toolkits<br> myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);<br>
pageIcon.templateData = myXML.toObject();<br> // rootIcon.setTitleText(templateData.learningObject[0].name);<br>}<br>rootIcon.setTitleText(templateData.learningObject[0].name);</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">The commented lines of code would be removed - they are just there to make explicit the changes I am proposing.</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">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.</p>
</div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">What do you think?</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
Given that the line</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">rootIcon.setTitleText(templateData.learningObject[0].name); </p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div>
<p class="MsoNormal" style="margin-left:72.0pt">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</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">pageIcon.setTitleText(pageIcon.templateData.pageType[0].name);</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
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.</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">
</p></div><div><p class="MsoNormal" style="margin-left:72.0pt">Kind regards</p></div><div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:72.0pt">Johnathan</p></div>
<div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div><p class="MsoNormal" style="margin-left:72.0pt"> </p><div><p class="MsoNormal" style="margin-left:72.0pt">On 21 February 2012 11:25, Julian Tenney <<a href="mailto:Julian.Tenney@nottingham.ac.uk" target="_blank">Julian.Tenney@nottingham.ac.uk</a>> wrote:</p>
<div><div><p class="MsoNormal" style="margin-left:72.0pt">Try this one please.</p><p class="MsoNormal" style="margin-left:72.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="margin-left:108.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a> [mailto:<a href="mailto:xerte-dev-bounces@lists.nottingham.ac.uk" target="_blank">xerte-dev-bounces@lists.nottingham.ac.uk</a>] <b>On Behalf Of </b>Kemp Johnathan<br>
<b>Sent:</b> 20 February 2012 22:51<br><b>To:</b> Xerte Developers Discussion List<br><b>Subject:</b> [Xerte-dev] Xerte editor closes if you add a setup script to the Learning Object icon</span></p></div><div><div><p class="MsoNormal" style="margin-left:108.0pt">
</p><div><p class="MsoNormal" style="margin-left:108.0pt">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..</p>
</div><div><p class="MsoNormal" style="margin-left:108.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:108.0pt">However I have hit a problem. I want to include one or more set up scripts as children of the Learning Object.</p>
</div><div><p class="MsoNormal" style="margin-left:108.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:108.0pt">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.</p>
</div><div><p class="MsoNormal" style="margin-left:108.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:108.0pt">If you then close down Xerte and then re-open the project the project behaves correctly until you try adding another page. </p>
</div><div><p class="MsoNormal" style="margin-left:108.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:108.0pt">Kind regards</p></div><div><p class="MsoNormal" style="margin-left:108.0pt"> </p></div><div><p class="MsoNormal" style="margin-left:108.0pt">
Johnathan</p></div></div></div></div><p class="MsoNormal" style="margin-left:72.0pt"> </p><p style="margin-left:72.0pt">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. </p>
<p style="margin-left:72.0pt">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. </p>
</div><p class="MsoNormal" style="margin-bottom:12.0pt;margin-left:72.0pt"><br>_______________________________________________<br>Xerte-dev mailing list<br><a href="mailto:Xerte-dev@lists.nottingham.ac.uk" target="_blank">Xerte-dev@lists.nottingham.ac.uk</a><br>
<a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev" target="_blank">http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev</a><br><br>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.<br>
<br>This message has been checked for viruses but the contents of an attachment<br>may still contain software viruses which could damage your computer system:<br>you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation.</p></div><p class="MsoNormal" style="margin-left:72.0pt"> </p></div></div></div></div><p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">
<br>_______________________________________________<br>Xerte-dev mailing list<br><a href="mailto:Xerte-dev@lists.nottingham.ac.uk" target="_blank">Xerte-dev@lists.nottingham.ac.uk</a><br><a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev" target="_blank">http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev</a><br>
<br>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.<br>
<br>This message has been checked for viruses but the contents of an attachment<br>may still contain software viruses which could damage your computer system:<br>you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation.<br><br></p></div><p class="MsoNormal" style="margin-left:36.0pt"> </p></div></div></div></div><br>_______________________________________________<br>
Xerte-dev mailing list<br>
<a href="mailto:Xerte-dev@lists.nottingham.ac.uk">Xerte-dev@lists.nottingham.ac.uk</a><br>
<a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev" target="_blank">http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev</a><br>
<br>
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.<br>
<br>
This message has been checked for viruses but the contents of an attachment<br>
may still contain software viruses which could damage your computer system:<br>
you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation.<br>
<br>
<br></blockquote></div><br>