[Xerte-dev] Re: Xerte editor closes if you add a setup script to the Learning Object icon

Kemp Johnathan johnathan.kemp at ntlworld.com
Tue Feb 21 16:52:48 GMT 2012


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>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] *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>
> 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] *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>
> wrote:
>
> Try this one please.
>
>
>
> *From:* 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
> 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
>
> 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
>
> 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-dev/attachments/20120221/8665b868/attachment.html>


More information about the Xerte-dev mailing list