com.bea.netuix.clipper
Interface IClipperUrlFilter


public interface IClipperUrlFilter

Interface for determining how links contained in the markup that is rendered in a clipper portlet should be rewritten. There are two kinds of URLs considered by this interface: "clickable" URLs and "resource" URLs.

You can register your own implementation of this interface to be used for a clipper portlet. To do that, set the portlet preference ClipperConstants.URL_FILTER_CLASS_PREFERENCE ("urlFilter").

If you don't want to write your own implementation, there are some simpler "presets" that you can configure. You can set the value of ClipperConstants.PROXY_RESOURCE_URLS_PREFERENCE ("proxyResourceUrls") to false to keep the system from proxying resource urls.

You can also set regular expression values in ClipperConstants.ALLOWED_URL_REGEX_PREFERENCE ("allowedUrlRegex") if you want to restrict the urls reachable from a clipper portlet. Both of those preference settings are ignored if you provide your own implementation.


Method Summary
 boolean allowUrl(String url)
          Should the url be reachable from the clipper portlet? If this method returns false, rewritten links containing this url will have empty values (for example, a link <a href="forbidden.site.com"> would be rewritten to <a href="" >.
 boolean rewriteClickableUrl(String url)
          Should the url be rewritten to render the response within portal context inside the clipper portlet? If this methods returns false then the response from this url will come straight from the target url, and it will be rendered in the full browser and not inside the clipper portlet.
 boolean rewriteResourceUrl(String url)
          For resource urls only, i.e.
 

Method Detail

allowUrl

boolean allowUrl(String url)
Should the url be reachable from the clipper portlet? If this method returns false, rewritten links containing this url will have empty values (for example, a link <a href="forbidden.site.com"> would be rewritten to <a href="" >.

Parameters
url - the url to be rewritten
Returns
true if the given url should be rewritten with rewriteClickableUrl or rewriteResourceUrl, else the URL will be rewritten to be empty.

rewriteClickableUrl

boolean rewriteClickableUrl(String url)
Should the url be rewritten to render the response within portal context inside the clipper portlet? If this methods returns false then the response from this url will come straight from the target url, and it will be rendered in the full browser and not inside the clipper portlet. This method applies to "clickable" urls only: links in anchors, form actions, etc.

Parameters
url - the url to be rewritten
Returns
true if the response for clicking the link should be rendered inside the clipper portlet, else the response will be rendered in the full browser outside of the portal context.

rewriteResourceUrl

boolean rewriteResourceUrl(String url)
For resource urls only, i.e. links in <img>, script, etc. tags. Should the resource be proxied through the portal server, or should the resource link point directly to the original resource in the remote page? Proxying is more expensive since it involves a hop through the portal server; however, it may be necessary if the remote page lives behind a firewall.

Parameters
url - the url to be rewritten
Returns
true if the request for the resource should be proxied through the portal server, else the URL will point directly at the resource from the remote page.


Copyright © 2011, Oracle. All rights reserved.