oracle.portal.provider.v1.http
Class URLProvider

oracle.portal.provider.v1.http.URLProvider
Direct Known Subclasses:
BasicURLProvider

public class URLProvider

This class is responsible for overriding the initSession method needed for cookie management. Cookies retrieved from external application will be stored in servlet session which can be utilised in later stages. It checks for login authentication and throws the login screen once the login credentials are false.

PDK-URL Services supports two types of authentication. Care has been taken for two types of authentication.


Constructor Summary
URLProvider()
           
 
Method Summary
 void deregister()
          overriding deregister method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider
 java.lang.Object getAuthentication()
          Gets the Authentication Details.
 java.lang.Object getHttpsProxyInfo()
          gets the https proxyInformation object
 java.lang.Object getProxyInfo()
          gets the proxyInformation object
 oracle.portal.provider.v1.ProviderSubscriber getSubscriber()
          overriding getSubscriber method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider
 java.lang.Object getSubscriberDetails()
          gets the Subscriber Information
protected  void init(long providerId, oracle.portal.provider.v1.ProviderLog logger, javax.servlet.ServletConfig sc, javax.servlet.http.HttpServletRequest request)
          Override superclass's init method to get the debuglevel from zone.properties using ServletConfig object.
 java.lang.Object[] initSession(oracle.portal.provider.v1.ProviderUser user, oracle.portal.provider.v1.ExternalPrincipal externalApp)
          Called to initialize the Provider in a particular user session.
 java.lang.String makeQueryString(oracle.portal.provider.v1.ExternalPrincipal externalApp, java.lang.String encoding)
          Method reads parameters specified in portal's external application through ExternalPrincipal (@see oracle.portal.provider.v1.ExternalPricipal) object, makes name value pairs out of them and returns the same.
protected  void readProxyInformation(HTTPClient.HTTPConnection loginHttpConnection)
          Reads proxy settings from XML File and sets this inforamtion on to the connection instance passed as an argument.
 oracle.portal.provider.v1.ProviderSubscriber register(java.lang.String subscriberID, java.lang.String portalVersion)
          overriding register method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider
 void setAuthentication(java.lang.Object authentication)
          Sets the authentication details,
 void setHttpsProxyInfo(java.lang.Object httpsProxyInfo)
          Set method for tag in provider.xml
 void setProxyInfo(java.lang.Object httpProxyInfo)
          Set method for tag in provider.xml
 void setSubscriberDetails(java.lang.Object subscriberDetails)
          Set method for tag in provider.xml
 void setUrlCookiePolicyHandler()
           setUrlCookiePolicyHandler method is a public method which set CookieModule.setCookiePolicyHandler(null), which means we are using default implemenatation.
 

Constructor Detail

URLProvider

public URLProvider()
Method Detail

init

protected void init(long providerId,
                    oracle.portal.provider.v1.ProviderLog logger,
                    javax.servlet.ServletConfig sc,
                    javax.servlet.http.HttpServletRequest request)
             throws oracle.portal.provider.v1.ProviderException
Override superclass's init method to get the debuglevel from zone.properties using ServletConfig object.

initSession

public java.lang.Object[] initSession(oracle.portal.provider.v1.ProviderUser user,
                                      oracle.portal.provider.v1.ExternalPrincipal externalApp)
                               throws oracle.portal.provider.v1.ProviderException
Called to initialize the Provider in a particular user session. This may be called never, once per user session, or once per request depending on how the provider is configured in the portal. If the Provider uses HTTP cookies or maintains state via a cookie-based HTTP session, it is imperative that (all) cookies be established during this call. initSession does following -Calls super to call initSession method of DefaultProvider -Extracts login url and login information from portal login server -Call private helper method extractCookies passing login information -Sets cookies names , values and other attributes -Returns array of cookie objects back. This is returned to portal -Also sets cookie string in session storage for retrival during render time.
Parameters:
user - Current provider user. Used for getting provider session and the portal user name.
Returns:
Array of cookie objects back. This is returned to portal
Throws:
ProviderException -  

setUrlCookiePolicyHandler

public void setUrlCookiePolicyHandler()

setUrlCookiePolicyHandler method is a public method which set CookieModule.setCookiePolicyHandler(null), which means we are using default implemenatation. Hence diffent sites can have there own cookie handler which override setCookiePolicyHandler.

CookiePolicyHandler

Sets a new cookie policy handler. This handler will be called for each cookie that a server wishes to set and for each cookie that this module wishes to send with a request. In either case the handler may allow or reject the operation. If you wish to blindly accept and send all cookies then just disable the handler with CookieModule.setCookiePolicyHandler(null);.

At initialization time a default handler is installed. This handler allows all cookies to be sent. For any cookie that a server wishes to be set two lists are consulted. If the server matches any host or domain in the reject list then the cookie is rejected; if the server matches any host or domain in the accept list then the cookie is accepted (in that order). If no host or domain match is found in either of these two lists and user interaction is allowed then a dialog box is poped up to ask the user whether to accept or reject the cookie; if user interaction is not allowed the cookie is accepted.

The accept and reject lists in the default handler are initialized at startup from the two properties HTTPClient.cookies.hosts.accept and HTTPClient.cookies.hosts.reject. These properties must contain a "|" separated list of host and domain names. All names beginning with a "." are treated as domain names, all others as host names. An empty string which will match all hosts. The two lists are further expanded if the user chooses one of the "Accept All from Domain" or "Reject All from Domain" buttons in the dialog box.


getSubscriber

public oracle.portal.provider.v1.ProviderSubscriber getSubscriber()
overriding getSubscriber method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider
Returns:
ProviderSubscriber

register

public oracle.portal.provider.v1.ProviderSubscriber register(java.lang.String subscriberID,
                                                             java.lang.String portalVersion)
                                                      throws oracle.portal.provider.v1.ProviderException
overriding register method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider
Returns:
ProviderSubscriber

deregister

public void deregister()
                throws oracle.portal.provider.v1.ProviderException
overriding deregister method of DefaultProvider oracle.portal.provider.v1.http.DefaultProvider

setProxyInfo

public void setProxyInfo(java.lang.Object httpProxyInfo)
                  throws oracle.portal.provider.v1.PortletException
Set method for tag in provider.xml
Parameters:
httpProxyInfo - ProxyInformation object

setHttpsProxyInfo

public void setHttpsProxyInfo(java.lang.Object httpsProxyInfo)
                       throws oracle.portal.provider.v1.PortletException
Set method for tag in provider.xml
Parameters:
httpsProxyInfo - ProxyInformation object

setSubscriberDetails

public void setSubscriberDetails(java.lang.Object subscriberDetails)
                          throws oracle.portal.provider.v1.PortletException
Set method for tag in provider.xml
Parameters:
subscriberDetails - SubscriberDetails object

setAuthentication

public void setAuthentication(java.lang.Object authentication)
Sets the authentication details,
Parameters:
authentication - Authentication object.

getAuthentication

public java.lang.Object getAuthentication()
Gets the Authentication Details.
Returns:
Authentication object.

getHttpsProxyInfo

public java.lang.Object getHttpsProxyInfo()
gets the https proxyInformation object
Returns:
ProxyInformation object.

getProxyInfo

public java.lang.Object getProxyInfo()
gets the proxyInformation object
Returns:
ProxyInformation object.

getSubscriberDetails

public java.lang.Object getSubscriberDetails()
gets the Subscriber Information
Returns:
SubscriberDetails object

readProxyInformation

protected void readProxyInformation(HTTPClient.HTTPConnection loginHttpConnection)
Reads proxy settings from XML File and sets this inforamtion on to the connection instance passed as an argument.

makeQueryString

public java.lang.String makeQueryString(oracle.portal.provider.v1.ExternalPrincipal externalApp,
                                        java.lang.String encoding)
                                 throws oracle.portal.provider.v1.AuthenticationException
Method reads parameters specified in portal's external application through ExternalPrincipal (@see oracle.portal.provider.v1.ExternalPricipal) object, makes name value pairs out of them and returns the same.
Parameters:
externalApp - ExternalPrincipal object holding external application details.
encoding - encoding style of parameters
Returns:
String name/value pairs