Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Class UriRewriterFactory


public class UriRewriterFactory

The UriRewriterFactory can be used to select the proper UriRewriter for transparently rewriting a target URI. Assuming the URI of interest is recognized by a UriRewriter implementation, then the user needs no foreknowledge of whether or not the URI has been rewritten on the server side to proxy to a producer and they can manipulate the target URI with the same methods whether or not the URI is a proxy URI. "Recognition" of a URI is based on the result of calling a UriRewriter's static groksUri() method.

Note: URIs with entity-encoded ampersands (&) should not be passed to this API. It should rarely be necessary to handle URIs with entity-encoded ampersands in client code. A URI, such as one that comes from the value of the href attribute of an anchor tag, will contain no evidence of HTML entity-encoding after it is in memory in the client.


Field Summary
public static object REWRITERS
            An array containing the list of UriRewriter implementations that are recognized by this factory.
 
Method Summary
public static bea.wlp.disc.uri.UriRewriter getUriRewriter(uriStr, [tmpltMap])
          Gets a UriRewriter implementation that understands how to work with the given URI string, based on the result of calling a UriRewriter's static groksUri() method.
 
Field Detail

REWRITERS

public static object REWRITERS
An array containing the list of UriRewriter implementations that are recognized by this factory. The order of this array is important. It determines the search order for a compatible URI rewriter. The GenericUriRewriter is normally last because it is a default rewriter that always has groksUri() == true.

Method Detail

getUriRewriter

public static bea.wlp.disc.uri.UriRewriter getUriRewriter(uriStr, [tmpltMap]) throws Error
Gets a UriRewriter implementation that understands how to work with the given URI string, based on the result of calling a UriRewriter's static groksUri() method. The default is the GenericUriRewriter if no match is found.
Parameters:
string uriStr - The string form of a URI
object [tmpltMap] - An optional map of key:value pairs for template replacement. For example, for the uriStr
		{protocol}://www.oracle.com/products?id={productId}
		
could have its template keys replaced by using a tmpltMap argument such as
		{protocol:'http', productId:'1001'}
		
This would result in
		http://www.oracle.com/products?id=1001
		
Returns:
bea.wlp.disc.uri.UriRewriter - A UriRewriter instance that understands how to work with the given URI string
Throws:
Error - Thrown when the uriStr is a javascript pseudo-protocol link (a link beginning with 'javascript:') that is not recognized. In this case, the URI cannot be parsed from the given string and the user should parse the URI out of the javascript before passing the uriStr to this constructor.


Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Copyright © 2011, Oracle. All rights reserved.