The
bug has been filed...
-----Original Message-----Thanks, I can take a look at it when you create the bug.
From: Henry Minsky [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 25, 2006 3:17 PM
To: William Krick
Cc: P T Withington; [email protected]
Subject: Re: [Laszlo-user] DataSet - type = http
On 7/25/06, William Krick <[EMAIL PROTECTED] > wrote:Below is a complete example that shows the problem.
I'm probably going to submit this as a bug.
<canvas height="400">
<!-- this path data is defined locally for this example but could
easily be stored in an XML file external to the application
to eliminate the need to recompile when the URLs change -->
<dataset name="ds_paths">
<paths>
<ds1>http://www.laszlosystems.com/cgi-pub/weather.cgi</ds1>
</paths>
</dataset>
<!-- this works -->
<dataset name="ds1" />
<datapointer xpath="ds_paths:/paths/ds1"
/>
<!-- this should work instead of the above 3 lines but it doesn't...
<dataset name="ds1" src="" />
-->
<simplelayout />
<button id="button1" text="Click for Today's Forecast"
/>
<text visible="true" bgcolor="yellow" width="${ button1.width}"
datapath="ds1:/weather/forecast/day[1]/@desc" />
</canvas>
-----Original Message-----
From: P T Withington [mailto: [EMAIL PROTECTED]]
Sent: Tuesday, July 25, 2006 11:26 AM
To: William Krick
Cc: [email protected]
Subject: Re: [Laszlo-user] DataSet - type = http
This seems like it's just plain a bug then. You should be able to
tell the dataset that you don't want it compiled in without having to
wire it to a particular protocol. If you specify `type="http"`, then
it won't try to parse your `src=` at compile time, but then it will
force the protocol to be http (which will not work if the app is
delivered using https).
There is some heuristic stuff in the compiler that appears to be
intended to cause your data to be loaded at run time if the compiler
can't parse the source path at compile time, but that must be broken,
given the error you are seeing. And that seems like a bad idea
anyways. This should not be magic, there should probably just be an
attribute that says whether the data is to be compiled in or loaded
at runtime. The `type` attribute is too overloaded.
I'd file a bug.
On 2006-07-25, at 11:15 EDT, William Krick wrote:
> Yeah, it doesn't seem to work.
>
> With this line...
>
> <dataset name="ds1" src="" />
>
> I get this error...
>
> unknown protocol: $path{'ds_paths
>
> ... it seems like it should work on paper. Any ideas?
>
>
>
> -----Original Message-----
> From: William Krick [mailto:[EMAIL PROTECTED] ]
> Sent: Tuesday, July 25, 2006 9:38 AM
> To: P T Withington
> Cc: [email protected]
> Subject: Re: [Laszlo-user] DataSet - type = http
>
>
> It might work, however, I seem to remember triggering it on the
> datapath's
> ondata event for a reason.
>
> I think that with your code, ds1 could try to initialize its source
> before
> ds_paths has finished loading.
>
> I'll have to play with it and see if it works.
>
>
> -----Original Message-----
> From: P T Withington [mailto: [EMAIL PROTECTED]]
> Sent: Monday, July 24, 2006 6:04 PM
> To: William Krick
> Cc: Andrew Chandler; [email protected]
> Subject: Re: [Laszlo-user] DataSet - type = http
>
>
> Would this be even simpler (untested):
>
> <dataset name="ds1" src="" />
>
> ?
>
> On 2006-07-24, at 17:30 EDT, William Krick wrote:
>
>> I don't know if this will help your situation or not but this is
>> the code
>> that we use to load our dataset URLs from an external XML file. We
>> need to
>> do this because we test our app locally as a proxied app, but
>> deploy it as a
>> SOLO app. A solo app requires the URLs to be relative. Having the
>> URLs in
>> an external file allows us to swap out the URLs by changing that
>> file. No
>> need to touch the code...
>>
>>
>> This is the code in "canvas"...
>>
>> <dataset name="ds_paths" request="true" type="http"
>> src="" />
>>
>> <dataset name="ds1"/>
>>
>> <datapointer xpath="ds_paths:/paths/ds1">
>> <method event="ondata">
>> parent.ds1.setAttribute( 'src', this.getNodeText() );
>> </method>
>> </datapointer>
>>
>> <dataset name="ds2"/>
>>
>> <datapointer xpath="ds_paths:/paths/ds2">
>> <method event="ondata">
>> parent.ds2.setAttribute( 'src', this.getNodeText() );
>> </method>
>> </datapointer>
>>
>>
>> <dataset name="ds3"/>
>>
>> <datapointer xpath="ds_paths:/paths/ds3">
>> <method event="ondata">
>> parent.ds3.setAttribute( 'src', this.getNodeText() );
>> </method>
>> </datapointer>
>>
>>
>>
>> The contents of paths.xml looks something like this...
>>
>> <paths>
>> <ds1> http://www.domain.com/dsservlet/getds1</ds1>
>> <ds2>http://www.domain.com/dsservlet/getds2</ds2>
>> <ds3> http://www.domain.com/dsservlet/getds3</ds3>
>> </paths>
>>
>>
>>
>>
>> Hmm... looking at the datapointer code above, it could
>> probably simplified a little too...
>>
>> <datapointer xpath="ds_paths:/paths/ds1"
>> />
>>
>>
>>
>> ...
>> Krick
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Andrew Chandler [mailto:[EMAIL PROTECTED] ]
>> Sent: Monday, July 24, 2006 5:09 PM
>> To: 'P T Withington'
>> Cc: [email protected]
>> Subject: Re: [Laszlo-user] DataSet - type = http
>>
>>
>> Hmmm - ok I'm basically trying to think of the questions India will
>> ask when
>> they get this tonight (the team doing most of the work is there).
>>
>> I re-read the docs - and I think the way I understood it is correct
>> but does
>> not contradict what you said.
>>
>> Given:
>> <dataset
>> src=""
>> id="dcrunstatdataset" name="dcrunstatdataset"
>> request="true">
>> </dataset>
>>
>>
>>
>> How can I restructure the src parameter to be a "url" without
>> having the
>> request information brought in? For instance I can't code in the
>> lzx
>> Src=""http://machineX:8085/visionaeldatacollector/work/">http://machineX:8085/visionaeldatacollector/work/
>> runstatistics.xml"
>>
>> Because the port, machine, are both things that are different for
>> each
>> install. I'm guessing the request object has to be used to get
>> the url?
>>
>>
>> -----Original Message-----
>> From: P T Withington [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, July 24, 2006 3:43 PM
>> To: Andy Chandler
>> Cc: [email protected]
>> Subject: Re: [Laszlo-user] DataSet - type = http
>>
>> If you specify the url without a protocol, the app protocol will be
>> merged
>> in.
>>
>> On 2006-07-24, at 15:49 EDT, Andy Chandler wrote:
>>
>>> (sorry - sent with work account before)
>>>
>>> When using a webapp that can be deployed either as http or https
>>> depending on the end users needs I've wondered if there isn't a
>>> better
>>> way for me to do the datasets.
>>>
>>> Most of our datasets that are file based are just relative
>>> referenced
>>> so
>>> they get compiled in when the page is compiled. However there are
>>> a couple
>>> that are more dynamic or might not be present - in this case it
>>> seems
>>> to work better (at least the page compiles) to use type=http or
>>> type=https.
>>> It would be nice if the dataset could just have an attribute like
>>> type="request" and it would automatically use http or https
>>> depending
>>> on how
>>> the app is being accessed. Has anyone seen something like that
>>> that
>>> already exists?
>>>
>>>
>>> _______________________________________________
>>> Laszlo-user mailing list
>>> [email protected]
>>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>>
>>
>> _______________________________________________
>> Laszlo-user mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>>
>>
>> _______________________________________________
>> Laszlo-user mailing list
>> [email protected]
>> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>
>
>
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>
>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]
_______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
