oracle.portal.provider.v1.http
Class BaseContentFilter

java.lang.Object
  |
  +--oracle.portal.provider.v1.http.BaseContentFilter
All Implemented Interfaces:
ContentFilter
Direct Known Subclasses:
HtmlFilter, XmlFilter

public abstract class BaseContentFilter
extends java.lang.Object
implements ContentFilter

BaseContentFilter is an absract class which contains methods that are common across filters.


Constructor Summary
BaseContentFilter()
           
 
Method Summary
protected  java.lang.String addJavaScriptSubmitFunction(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.String htmlSource, int debugLevel)
          Creates an Html Form, whose action url points to the Parallel Servlet, and which encloses the portlet content.
protected  java.lang.String addJavaScriptToLink(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.StringBuffer htmlSource, java.lang.String baseHref, java.lang.String tag, java.lang.String attribute, int debugLevel)
          Method adds javasript to HREF's in URLContent, to route the event through Parallel Page Engine, instead of directly opening the link.
protected  java.lang.String authenticateBasicLoginLinks(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.String urlContent, java.lang.String userInfo, int debugLevel)
           
protected  java.lang.String authenticateFormLoginLinks(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.String urlContent, java.lang.String redirectUrl, int debugLevel)
          Helper method which authenticates all hrefs with login server url.
 java.lang.String getBaseHRef()
          Get method for basehref tag.
protected  java.lang.String getBaseHRef(oracle.portal.provider.v1.PortletRenderRequest pr)
          Method does the following things - Searches the request to see if inline rendering parameter is received. Else reads pageUrl parameter from the respective managed renderer. Extracts base href from the above url.
 java.lang.String getInlineRendering()
          Returns if this portlet has inline rendering capabilities.
protected  java.lang.String getRedirectUrlFieldName()
          Get method for tag in provider.xml
 java.lang.String getSecBaseHRef()
          Get method for secondary basehref.
protected  java.lang.String getUrlContentType()
          Returns the URL content type.
protected  java.lang.String getUseAuthLinks()
          Returns the value of useAuthLinks.
protected  java.lang.String getUsePortalStyle()
           
protected  java.lang.String parseBaseHref(java.lang.String pageUrl)
          Utility method which parses given URL and retrieves base href from it.
protected  java.lang.String popBaseHref(java.lang.String urlContent)
          Method which parses URLContent, removes any tag and returns value of base href.
protected  void renderContents(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.String urlContent, int debugLevel, int type)
           
protected  java.lang.String replaceAuthLinks(oracle.portal.provider.v1.PortletRenderRequest pr, java.lang.String tag, java.lang.String attribute, java.lang.String InhtmlSource, java.lang.String baseHref, boolean isBasicAuth, int debugLevel)
          Method replaces HREF's to Login server HREF's, in the passed content.
 void setBaseHRef(java.lang.String baseHRef)
          Method for setting base href.
 void setInlineRendering(java.lang.String renderInline)
          Sets the inline rendering of portlet links to true/false;
 void setRedirectUrlFieldName(java.lang.String redirectUrl)
          Set method for tag in provider.xml This will be used while making authenticated hyper links.
 void setRemoveClassProperty(java.lang.String removeClassProperty)
          Indicates URL Services to remove any styles used by this application.
 void setSecBaseHRef(java.lang.String secBaseHref)
          Setter method specified in provider.xml, added for relative links not preceeded by /.
 void setUrlContentType(java.lang.String type)
          sets the type of URL specified for a given rendering mode.
 void setUseAuthLinks(java.lang.String flag)
          Specifies if the links have to be authorized.
 void setUsePortalStyle(java.lang.String usePortalStyle)
          Specifies if the portlet style should be made compliant to portal style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.portal.provider.v1.ContentFilter
filterContent
 

Constructor Detail

BaseContentFilter

public BaseContentFilter()
Method Detail

authenticateFormLoginLinks

protected java.lang.String authenticateFormLoginLinks(oracle.portal.provider.v1.PortletRenderRequest pr,
                                                      java.lang.String urlContent,
                                                      java.lang.String redirectUrl,
                                                      int debugLevel)
Helper method which authenticates all hrefs with login server url. The provider renders the portlet according to the authorization embodied in the cookie. All the links on the portlet that require authenticated access must be wrapped with a call to the login server's external application login processing routine. The Parallel Page Engine sends along the information necessary to do this wrapping, as provided by the Portal. Basically, each link is of the format http://loginserver.domain.com/pls/ls/ls.wwsso_app_admin.fapp_process_login?p_app_id=103&p_url_name=FlightDest&p_url_value="http://myserver.com/flights/flightAction=details" Here, 'p_app_id' is the application ID registered in the login server, 'p_url_name' is the parameter name recognized by the External Application's Login URL as a URL that should be redirected to after a successful authentication. p_url_value' is the URL location that is requested. Sample href href="http://incq080f.idc.oracle.com:8088/pls/portal30_sso/portal30_sso.wwsso_app_admin.fapp_process_login? p_url_value=http://152.69.169.62/servlets/flights/Flightaction/Ddetails/FlightId=123456 &p_url_name=FlightDest &p_app_id=103 This works on the assumption that the url's that need to be wrapped by login server need to be absolute urls and not relative urls
Parameters:
pr - PortletRenderRequest
urlContent - Url Content whose hrefs need to be authenticated.
Returns:
String Authenticated Url Content

authenticateBasicLoginLinks

protected java.lang.String authenticateBasicLoginLinks(oracle.portal.provider.v1.PortletRenderRequest pr,
                                                       java.lang.String urlContent,
                                                       java.lang.String userInfo,
                                                       int debugLevel)

replaceAuthLinks

protected java.lang.String replaceAuthLinks(oracle.portal.provider.v1.PortletRenderRequest pr,
                                            java.lang.String tag,
                                            java.lang.String attribute,
                                            java.lang.String InhtmlSource,
                                            java.lang.String baseHref,
                                            boolean isBasicAuth,
                                            int debugLevel)
Method replaces HREF's to Login server HREF's, in the passed content.
Parameters:
pr - ProviderRequest for this rendering.
tag - contains tag ,that contains relative url
attribute - contains the attribute containing relative url
InhtmlSource - String containing the HtmlSource of pageURL
baseHref - contains BaseHref tag
Returns:
String contents with absolute url

setUsePortalStyle

public void setUsePortalStyle(java.lang.String usePortalStyle)
Specifies if the portlet style should be made compliant to portal style.
Parameters:
flag - Check used to see if links have to be authorized.

setUseAuthLinks

public void setUseAuthLinks(java.lang.String flag)
Specifies if the links have to be authorized.
Parameters:
flag - Check used to see if links have to be authorized.

getUseAuthLinks

protected java.lang.String getUseAuthLinks()
Returns the value of useAuthLinks.
Returns:
String "true"/"false" depending on whether links are authorized or not.

getRedirectUrlFieldName

protected java.lang.String getRedirectUrlFieldName()
Get method for tag in provider.xml
Returns:
redirectUrlFieldName value

setRedirectUrlFieldName

public void setRedirectUrlFieldName(java.lang.String redirectUrl)
Set method for tag in provider.xml This will be used while making authenticated hyper links. Essentially this is the field name understood by external application whose value points to the Url location to be redirected to, after successful authentication.
Parameters:
redirectUrl - Value of redirect url field.

setUrlContentType

public void setUrlContentType(java.lang.String type)
sets the type of URL specified for a given rendering mode.
Parameters:
String - of URL specified

getUrlContentType

protected java.lang.String getUrlContentType()
Returns the URL content type.
Returns:
String URL Content Type (text/html or text/xml)

getUsePortalStyle

protected java.lang.String getUsePortalStyle()

setRemoveClassProperty

public void setRemoveClassProperty(java.lang.String removeClassProperty)
Indicates URL Services to remove any styles used by this application. Helpful in applying portal look and feel to the external application.
Parameters:
removeClassProperty - Remove external applicaiton styles (true/false).

addJavaScriptSubmitFunction

protected java.lang.String addJavaScriptSubmitFunction(oracle.portal.provider.v1.PortletRenderRequest pr,
                                                       java.lang.String htmlSource,
                                                       int debugLevel)
Creates an Html Form, whose action url points to the Parallel Servlet, and which encloses the portlet content. This in turn makes it possible to redirect any events occuring in the portlet to the parallel page engine.
Parameters:
pr - PortletRenderRequest
htmlSource - HTML content fetched from pageUrl.
debugLevel - debug level parameter specified in zone.properties.

addJavaScriptToLink

protected java.lang.String addJavaScriptToLink(oracle.portal.provider.v1.PortletRenderRequest pr,
                                               java.lang.StringBuffer htmlSource,
                                               java.lang.String baseHref,
                                               java.lang.String tag,
                                               java.lang.String attribute,
                                               int debugLevel)
Method adds javasript to HREF's in URLContent, to route the event through Parallel Page Engine, instead of directly opening the link. Parallel Page Engine will in turn redirects this event to appropriate renderer. URL pointed to by the link will be received by URLRenderer and this will become the new page url and the cycle continues.
Parameters:
pr - PortletRenderRequest
htmlSource - HTML content fetched from pageUrl.
baseHref - base href for making absolute links.
tag - Name of the html tag
attribute - name of attribute in the tag specified by {tag}
debugLevel - debug level parameter specified in zone.properties.

setInlineRendering

public void setInlineRendering(java.lang.String renderInline)
Sets the inline rendering of portlet links to true/false;
Parameters:
renderInline - true/false

getInlineRendering

public java.lang.String getInlineRendering()
Returns if this portlet has inline rendering capabilities.
Returns:
String true/false

popBaseHref

protected java.lang.String popBaseHref(java.lang.String urlContent)
Method which parses URLContent, removes any tag and returns value of base href.
Parameters:
urlContent - URL Content to be searched for base href.
Returns:
basehref from URL Content. If none found, returns null.

setBaseHRef

public void setBaseHRef(java.lang.String baseHRef)
Method for setting base href.
Parameters:
baseHRef - value of base href.

getBaseHRef

public java.lang.String getBaseHRef()
Get method for basehref tag.
Returns:
Base Href.

getSecBaseHRef

public java.lang.String getSecBaseHRef()
Get method for secondary basehref.
Returns:
Secondary Base Href.

setSecBaseHRef

public void setSecBaseHRef(java.lang.String secBaseHref)
Setter method specified in provider.xml, added for relative links not preceeded by /. If the domain is ,
http://aria.us.oracle.com:7777/
and the portlet is from page http://aria.us.oracle.com:7777/pls/oracle/
For tags that contain relative links without a /
ex ., "img src="test.gif""
the replaced relative url should be
 img src="http://aria.us.oracle.com:7777/pls/oracle/test.gif"  
but if baseHref is used in these cases , the replaced relative url will be,
 img src="http://aria.us.oracle.com:7777/test.gif" 

which will not work !

parseBaseHref

protected java.lang.String parseBaseHref(java.lang.String pageUrl)
Utility method which parses given URL and retrieves base href from it. Any parameters appended to this URL will be removed and the base Url will be returned. example : Given URL :- http://myserver.com:myport/page?param1=value1¶m2=value2 Base Href parsed :- http://myserver.com:myport/page.
Parameters:
pageUrl - URL from which base href needs to be extracted

getBaseHRef

protected java.lang.String getBaseHRef(oracle.portal.provider.v1.PortletRenderRequest pr)
                                throws oracle.portal.provider.v1.PortletException
Method does the following things -

renderContents

protected void renderContents(oracle.portal.provider.v1.PortletRenderRequest pr,
                              java.lang.String urlContent,
                              int debugLevel,
                              int type)
                       throws oracle.portal.provider.v1.PortletException