PDA

View Full Version : Extending dataset?


sfarrow
10-14-2003, 12:50 PM
Thought I had come up with a clever approach to deal with submitting large XML to the server in chunks. My approach involved creating a class that extends dataset and all seems to work well. I just discovered when I scrolled my browser down to the bottom of the canvas a compiler warning I had missed.

Compilation Warnings
myFile.lzx:291:39: element "myDataset" from namespace "http://www.laszlosystems.com/2003/05/lzx" not allowed in this context

LPS does not appear to like my dataset extension, but the class otherwise seems to work fine. Any other way I can avoid the warning?

I had taken this approach because I could easily slip it into my existing code where required and then once POST handles my large XML, slip it out again.

Steve

antun
10-15-2003, 11:31 AM
If you don't want the warnings, just create a custom HTML wrapper page. The way the LPS works is that by default, if you make a HTTP request to an .lzx file, it will send back an HTML wrapper page that includes any compilation warnings. When you create a custom wrapper, you're effectively just requesting the SWF.

There's a tip on how to create a custom wrapper here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=25

-Antun

santy
12-02-2005, 09:45 AM
I have also created a subclass of dataset, and am seeing the same warning as sfarrow. I realize that it is possible to hide the warnings, but it bothers me that subclassing dataset would give warnings at all. Is there anything that we can do to fix the root problem, instead of hiding the symptoms?

Regards,
Mike

paou
03-17-2006, 03:27 AM
This one just got me too.

I don't want to turn off the warnings, as we're developing (and warnings are neccesary)

However... my collegues are complaining about the warning from subclassing dataset.

Any ideas / solutions?

jcmaxx
03-17-2006, 05:08 PM
Add me to the list of people who would really like to see this fixed. If we get enough requests, is there any chance of something happening?

jsundman
03-18-2006, 06:34 AM
Although it's not very well documented, dataset can not be extended. If there were such a thing as sealed classes in LZX, dataset would be a sealed class. This is acknowledged as a problem.

We were talking about this yesterday at an OpenLaszlo planning meeting in the context of figuring out what modifications we need to make to LZX to support all the things we want to do over the next year or so, especially supporting two runtimes. The amount of work to be done is quite impressive, and I don't recall where this dataset issue fell on the list.

Over the next few weeks we will post a draft of the proposed work for OpenLaszlo 4.0, and we will solicit feedback from the community on how to priortize the work.

Please continue to consult openlaszlo.org for updates on how the road map is shaping up. We are working hard to put into place the mechanisms by which you can participate in this process.

Disclaimer: this is my understanding of where this issue stands. Official word will come from Amy Muntz, the OpenLaszlo program manager, or Jim Grandy, Director of engineering. As I said, it may take a little while before there is a definitive answer.

paou
03-19-2006, 10:42 PM
Thanks for the response,

Does this mean that although the extensions we are using to dataset work, they may cause problems in future, or may promote unexpected results?

As far as I'm aware, the only problem I encoutered so far was the warning message, so should I strip out my oninit handlers into each seperate instance of dataset, or is it safe to stay with the class?

jsundman
03-21-2006, 11:16 AM
Apologies, I simply don't know the answer to your question. I will see if I can get any of my openlaszlo colleagues to chime in witn an opinion.

I suspect that the answer will be "unknown" for a few more weeks until we figure out what the proper direction will be for this.

However, I'll try to get something a little more helpful than that. It may take a few days, as the architecture guys are neck-deep in figuring out what has to be done to the object model in order to efficiently support compiliation to actionscript 1 & 2, DHTML, and Flash 9, etc.

jstretch
03-21-2006, 11:36 AM
Try my girlfriend's cooking...you'll have more run-times than you can imagine.

santy
04-05-2006, 07:06 AM
As an alternative to subclassing dataset, has anyone considered creating a new dataset wrapper class.

I'm thinking that if this wrapper class contained a dataset, implemented all of the methods of a dataset as a passthrough to the wrapped dataset, we would be able to get around the restriction of not being able to extend dataset.

Thoughts?

Regards,
Mike

bfagan
04-05-2006, 11:52 AM
I kicked this idea around for 10 minutes, but I passed on it. I think you would have a problem in that everytime you extend on top of that, your local dataset would become buried deeper and deeper. Even if you were to set the datapath to such a deep level, I'm not sure your datapaths addressing this extended dataset would work.

lankynibbs
05-10-2006, 09:59 AM
Any news on this issue?

We are using .NET 2.0 on our server backend, and make extensive use of tableadapters to keep our data layer uniform and easy to use.

We got it into our heads yesterday that if we wrote a set of extended Laszlo datasets which mirror our tableadapters, we'd enjoy the benefits of strong-typedness in Laszlo and accelerate our presentation layer development.

Alas, I sit down to extend the dataset class this morning, and discover that you can't do it directly.

Doh!

pcawdron
02-04-2007, 01:20 AM
Seeing how this post was started in 2003 and hasn't been resolved yet, I'm probably flogging a dead horse but... can a class extend a dataset?

I'm building a class that manages my XML interactions (requests, updates, inserts, deletes, etc). It works fine, no problems at all, but it brings up the error described above. Any ideas? Any alternatives?

Cheers,
Peter

Error: element "xql" not allowed in this context. Check whether it is spelled correctly, and whether a class with this name exists.

<canvas debug="true">

<class name="xql" extends="dataset" src="http://localhost:8080/exist/xquery/xql-request.xql" request="false" type="http">
<attribute name="command" type="string" value="request"/>
<attribute name="XMLfile" type="string" value="not-defined"/>
<attribute name="XMLParentNode" type="string" value=""/>
<attribute name="XMLChildNode" type="string" value=""/>
<attribute name="criteria" type="string" value=""/>
<attribute name="criteriaValue" type="string" value=""/>
<method name="fetch">
<![CDATA[
var p=new LzParam();
var d=this;
p.addValue("XMLfile",this.XMLfile, false);
p.addValue("XMLnode",this.XMLParentNode, false);

switch(this.command){
case "request":
p.addValue("XMLcriteria",this.criteria, false);
p.addValue("XMLcriteriaValue",this.criteriaValue, false);
d.setQueryString(p);
d.doRequest();
break;
}
]]>
</method>
</class>

<xql name="myXQL" XMLfile="doc('/db/tutorial/mybooks.xml')" XMLParentNode="/mybooks/bookcase" XMLChildNode="/book"/>

<view name="myTable">
<simplelayout axis="y"/>
<button name="getStudy" text="What's in the study?" onclick="myXQL.criteria='@location';myXQL.criteriaValue='St udy';myXQL.fetch()"/>
<view name="rowOfData" datapath="myXQL:/bookcase">
<simplelayout axis="y" spacing="10" />
<text datapath="book/text()" width="200" />
<text datapath="@publisher" width="200" />
</view>
</view>
</canvas>

senshi
02-04-2007, 05:20 AM
can a class extend a dataset?
As far as I know: No!

Any ideas? Any alternatives?
Maybe writing a wrapper around a dataset.
Something like this...

<class name="mydataset" extends="node" >
<dataset name="innerdataset" />
</class>

<mydataset name="myDS" />

<node datapath="local:parent.myDS.innerdataset:/root/entry[1]" />