[Xerte] Re: What part of the object am I looking at?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Thu Aug 18 14:22:36 BST 2011


It does that.

debug(icon.fileData); in the onReadFile handler. See attached.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 13:53
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?


Yes, got that far but it's still a PITA to tell where to truncate/substr it off to get just the returned data


Shouldn't it have it's own property, sort of like templateData?


loadVarData: "the string returned from the server"



________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 13:19:41 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
unescape(string) will decode a URLEncoded string to a friendly string.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 12:58
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?

>From initial post at bottom :-)




inspect(efid.loadVars); //returns below
===============
Value_a TEXT Value_B TEXT Value_c TEXT

:
onLoad : [type Function]
icon : _level0.engine.IFC.FW_ENT
===============



debug(efid.loadVars); //returns below
==================
Value%5Fa%20TEXT%09Value%5FB%20TEXT%09Value%5Fc%20TEXT%0D%0A=&onLoad=%5Btype%20Function%5D&icon=%5Flevel0%2Eengine%2EIFC%2EFW%5FENT
===================







________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 12:50:02 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
That's what you get from debug(loadVars)? Or inspect(loadVars)

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 12:37
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?



Yes, sendandloadsvars does what I want.


It is just a case of knowing where to truncate the returned data so only the server data is returned.


Heres a typical returned string:


===================
Value_a TEXT Value_B TEXT Value_c TEXT

:
onLoad : [type Function]
icon : _level0.engine.IFC.FW_ENT
=======================



If I want the value of icon:
debug(efid.loadVars.icon)  //  _level0.engine.IFC.FW_ENT


If I want the value of onLoad:
debug(efid.loadVars.onLoad)  //  [type Function]


If I want the value of the string returned from the server:
??




________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 11:57:17 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
Hang on, back pedal a minute, why doesn't loadVars do what you want? I know it has those properties in there, but it still has the (correct) return string and you can get at it?

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 11:55
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?

I need to post data.








From: Julian.Tenney at nottingham.ac.uk

To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 11:25:32 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
Try readFile(yourASPFile);

>From the engine:

ICON.prototype.readFile = function(url){
                this.rf = new LoadVars();
                this.rf.icon = this;
                this.rf.load(url);
                this.rf.onData = function(src){
                                this.icon.fileData = src;
                                this.icon.broadcast('onReadFile');
                }
}

So it still uses loadVars to get thigs moving, but it handles the onData event, rather thanonLoad, which lets you get at the raw data returned from the server. That should do it. Debug(someIcon.fileData) in your 'onReadFile' event handler.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 18 August 2011 11:01
To: Xerte discussion list
Subject: [Xerte] Re: What part of the object am I looking at?

What do you want to get? Some loadVars formatted text from the asp page?

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 10:59
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?

Ah, OK.


Do I have any other options for sending/loading non-XML structured  data (using post)?
Or is  sendAndLoadVars it?


I'm trying to use the same db/asp setup for Xerte that an AW piece has been using for years.
No XML input or output.
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 10:35:59 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
ICON.prototype.sendAndLoadVars = function(url, loadVarsObj){
                this.loadVars = new LoadVars();
                this.loadVars.icon = this;
                loadVarsObj.sendAndLoad(url, this.loadVars, "POST");
                this.loadVars.onLoad = function(success){
                                this.icon.broadcast('onSendAndLoadVars')
                }
}


You get someIcon.loadVars, nothing else.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 August 2011 10:24
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?



I'm missing a point I think.


The data returned by someicon.sendAndLoad ends up in someicon.templateData right?
I don't get anything in templateData besides what the server sent back.


The data returned by someicon.sendAndLoadVars ends up in someicon.loadVars?
Along with those other property/value pairs?
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Thu, 18 Aug 2011 09:20:50 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
The engine sets those properties, but it's nothing weird: that's how you should handle the onLoad, i.e. myLV.onLoad =  function{..blah..}

When you inspect it you see the function as a property. Icon is added as a property so that the LV knows which icon to broadcast onLoad from. So I'm not surprised to see them there, but it is confusing how to get at the actual result. I've never used LoadVars myself, but I expect what is happening is that lv is a string object: if you debug(myLV) you get object? Whatabout String(myLV)?

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 17 August 2011 17:29
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?



The thing I'm curious about is the additional properties in the return.


I thought the only thing in the someIcon.loadVars would be what was returned by the call to the server.


e.g.
Value_a TEXT Value_B TEXT Value_c TEXT



where is the rest coming from?
=&onLoad=[type Function]&icon=_level0.engine.IFC.FW_ENT





I really just need to know where I truncate that string so as to just extract the return string.
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Wed, 17 Aug 2011 13:40:35 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
Sorry. Duh, RootIcon == ifc. rootIcon.loadVars is the same thing as rootIcon.loadVars. Must have had too much holiday.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 17 August 2011 13:38
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?

odd.


debug(rootIcon.ifc.loadVars);
undefined


debug(ifc.loadVars);
Value%5Fa%20TEXT%09Value%5FB%20TEXT%09Value%5Fc%20TEXT%0D%0A=&onLoad=%5Btype%20Function%5D&icon=%5Flevel0%2Eengine%2EIFC%2EFW%5FENT
________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Wed, 17 Aug 2011 13:26:03 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
Here's the function in the engine:

ICON.prototype.sendAndLoadVars = function(url, loadVarsObj){
                this.loadVars = new LoadVars();
                this.loadVars.icon = this;
                loadVarsObj.sendAndLoad(url, this.loadVars, "POST");
                this.loadVars.onLoad = function(success){
                                this.icon.broadcast('onSendAndLoadVars')
                }
}

So try decode() on rootIcon.ifc.loadVars?

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 17 August 2011 13:23
To: Xerte list
Subject: [Xerte] Re: What part of the object am I looking at?



debug(ifc.loadVars.decode());


false
Help: "Sets the object iconID.loadVars with the resulting loadVars  properties."

Should the returned data have it own prop?







________________________________
From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Wed, 17 Aug 2011 13:15:19 +0100
Subject: [Xerte] Re: What part of the object am I looking at?
myLV.decode();

??

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 17 August 2011 11:40
To: Xerte list
Subject: [Xerte] What part of the object am I looking at?



vars = new LoadVars ();

vars.CCID = 200;
ifc.sendAndLoadVars('http://www.myserver.com/daveRead.asp', vars);


returns a tab delimited string.


inspect(ifc.loadVars); //returns below


===============
Value_a TEXT Value_B TEXT Value_c TEXT

:
onLoad : [type Function]
icon : _level0.engine.IFC.FW_ENT
===============




debug(ifc.loadVars); //returns below


==================
Value%5Fa%20TEXT%09Value%5FB%20TEXT%09Value%5Fc%20TEXT%0D%0A=&onLoad=%5Btype%20Function%5D&icon=%5Flevel0%2Eengine%2EIFC%2EFW%5FENT
===================




How do I get at just my returned data?
It doesn't seem to have a property.




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 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 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 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 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 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 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 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 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 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/20110818/9e7379e3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readFIle.rlo
Type: application/octet-stream
Size: 618 bytes
Desc: readFIle.rlo
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110818/9e7379e3/attachment-0001.obj>


More information about the Xerte mailing list