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

Reply via email to