[Xerte] Re: Reading POST parameters from web page in RLO

Julian Tenney Julian.Tenney at nottingham.ac.uk
Thu Apr 5 15:43:55 BST 2012


Sorry, getURL doesn'rt return data. You need to use ExtnerlaInterface.call - but for some reason that calss isn;'t available to Xerte script, so I wrapped it in callJS(func, params);

Try

result = callJS('myFunction', 'Hi');
debug(result);

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan
Sent: 05 April 2012 15:35
To: Xerte discussion list
Subject: [Xerte] Re: Reading POST parameters from web page in RLO

I am trying to do something very similar to Ron - I want to pass a pageID in the url and trap it in xerte so that a url can be used to not just open a Xerte project but also to go to a specific page in that project.

I have the function sorted to trap the parameters from the url, but I can't get the passing of data back to Xerte to work.

I tried your suggestion and also found a suggested form from Julian, posted in August 2007

in rloObject.js I have

function myFunction(arg){
alert('I am a function and my argument is ' + arg);
return arg.toUpperCase();
}

simple enough function as a test.

Then in my Xerte script on the test title page I have

mydata = getURL("javascript:myFunction('a test');","");

if (mydata != undefined){
titleStr = mydata;
} else {
titleStr = "data not received";
}

I publish the project and then test it in Firefox and Opera

In both Opera and Firefox the alert displays.
In Opera the title of the page displays as "data not received".
In Firefox the xerte display is displayed without anything in the page title whilst the alert is displayed. When the alert is clicked, very briefly the Xerte page displays with the title as "data not received" then the whole screen is replaced with a white screen with the text "A TEST" displayed. So this shows the function is returning something, but Xerte is not capturing it.

What am I doing wrong here?

Kind regards

Johnathan


On 3 April 2012 21:50, Dave Burnett <d_b_burnett at hotmail.com<mailto:d_b_burnett at hotmail.com>> wrote:

Launch index.htm with your parameters:

www.server.com/dir/index.htm?courseid=224&sname=fred<http://www.server.com/dir/index.htm?courseid=224&sname=fred>

add a javascript function to rloObject.js to get the querystring values:

function getdata() {
//code to get value pairs from URL querystring
//and return them
}


Call from within your Xerte piece:
mydata = getURL('javascript:getdata("");', '');




________________________________
From: knowledgeware at kccsoft.com<mailto:knowledgeware at kccsoft.com>
To: xerte at lists.nottingham.ac.uk<mailto:xerte at lists.nottingham.ac.uk>
Date: Tue, 3 Apr 2012 13:31:16 -0700

Subject: [Xerte] Re: Reading POST parameters from web page in RLO

Hello Julian - if I use object/embed I'll be using flashvars, correct?



I'm not sure how I could use js to get/set values. I need to pass some critical info in like courseID, LoginID, etc that is specific to each user, so I don't see how I can 'read' a URL from xerte. Is there a way with js I can pass these specific values to the RLO when launched?



Thanks

RonM2



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 Julian Tenney
Sent: Tuesday, April 03, 2012 1:12 AM
To: Xerte discussion list
Subject: [Xerte] Re: Reading POST parameters from web page in RLO



Either pass them inot the piece from the web page via the object / embed stuff, or (better) write some javascript functions you can call from Xerte to get / set values.



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:[mailto:xerte-bounces at lists.nottingham.ac.uk]> On Behalf Of KnowledgeWare
Sent: 02 April 2012 22:10
To: Xerte discussion list
Subject: [Xerte] Reading POST parameters from web page in RLO



Anyone have an example of reading 'POST' parameters in xerte desktop?



I'd like to launch an RLO from a webpage and pass in several parameters like courseID, LoginID, etc., but not clear on how I can 'read' them in when the xerte flowline starts. Do I need a JS wrapper for this?



RonM2


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/20120405/ccba26bf/attachment-0001.html>


More information about the Xerte mailing list