[Laszlo-dev] [Laszlo-user] API change proposal: LzView.add/removeProxyPolicy()
David Temkin
temkin at laszlosystems.com
Thu May 29 12:07:22 PDT 2008
Max, Henry,
Can this be solved using the existing mechanism of a custom
dataprovider, which could implement a proxy policy? That was one
intention of the dataprovider API.
Better to do this in one place, as opposed to adding a new API for this.
- D.
On May 28, 2008, at 4:43 PM, Max Carlson wrote:
> Sounds good to me! By the way, I filed a bug to track the proxy
> policy API change: http://jira.openlaszlo.org/jira/browse/LPP-6058
>
> Can you file one for doing the same with the proxyhost attribute?
> Thanks!
>
> Henry Minsky wrote:
>> A related issue, it would be nice to be able to specify the URL of
>> the proxy host, instead of it being
>> hardcoded to be the app url. How about a proxyhost attribute that
>> you can set in a similar manner?
>> On Wed, May 28, 2008 at 3:00 PM, Max Carlson <max at openlaszlo.org <mailto:max at openlaszlo.org
>> >> wrote:
>> Hi Folks,
>> I was thinking of deprecating the LzView.add/removeProxyPolicy()
>> APIs in favor of a new, simpler system. The current API looks
>> like
>> this:
>> LzView.addProxyPolicy ( f )
>> Adds a function which can decide how the media at a given URL
>> should
>> be loaded
>> @param Function f: A function that takes a URL as a string and
>> returns one of true, false, or null meaning respectively that the
>> request should be proxied by the LPS server; made directly to the
>> URL; or should be passed to the next policy function in the list.
>> The default policy function returns the value of canvas.proxied
>> LzView.removeProxyPolicy ( f )
>> Removes a proxy policy function that has been added using
>> LzView.addProxyPolicy
>> @param Function f: The function to remove from the policy list
>> @return Boolean: Returns true if the function was found and
>> removed,
>> false
>> if not
>> Instead, each view would be able to set its own proxy policy.
>> If a
>> view does not have an explicit proxy policy set, it looks up the
>> parent chain until it finds one. The canvas always has a default
>> proxy policy set. Views can change their proxy policy like this:
>> anyview.setProxyPolicy ( f )
>> Sets a proxy policy function on a per-view basis.
>> @param Function f: The function to use for this view's proxy
>> policy
>> Let me know what you think!
>> -- Regards,
>> Max Carlson
>> OpenLaszlo.org
>> --
>> Henry Minsky
>> Software Architect
>> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>
> --
> Regards,
> Max Carlson
> OpenLaszlo.org
More information about the Laszlo-dev
mailing list