Welcome to Apache Portals Web Content Application

Get Portals Web Content App

Download Portals Applications WebContent 1.3

A portlet application dedicated to the development of Web Content rewriting and IFrame based web content. The portlet applications here are designed to host content from another web site or local servlet inside of a portlet window.

The Web Content portet application consists of three portlets that have similiar functionality, but different approaches:

All the portlets host content from a different website or local servlet inside a portlet window.

The IFrame Portet achieves this by embedding an HTML iframe within a portlet.

The ReverseProxy IFrame Portlet behaves in the same way as IFrame Portlet does, except that it uses Reverse Proxy Service URLs instead of the original SRC URLs. By using Reverse Proxy service component, more sophisticated content can be served by setting content rewriting configurations or Cross-Domain Scripting can be enabled. The Web Content Application includes Reverse Proxy Service servlet and component.

The Web Content portlet takes a more complicated approach: it actually embeds the content of the remote website inside the HTML payload delivered by the portal, without the help of the browser. This approach is more complicated since it may require rewriting all links within the hosted website, that is, if you want to keep the website navigation inside the portlet window. While a noble cause, this approach is far from perfect and does not always work correctly.

If you are interested in secure versions of these portlets, see the Jetspeed-specific versions of the IFrame, ReverseProxyIFrame, or WebContent portlets found at the Jetspeed J2-Admin website. The SSOIFrame, SSOReverseProxyIFrame and SSOWebContent portlets leverage the Jetspeed SSO Services, and are not portable to other portal servers.

Here are the classes to declare when using the portlets:

<portlet-class>org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet</portlet-class>        
      

Note: The ReverseProxyIFramePortlet uses the same class, but has different preferences configurations.

or

<portlet-class>org.apache.portals.applications.webcontent.portlet.WebContentPortlet</portlet-class>        
      

Web Content Portlet Preferences

Name Example Value Description
SRC http://www.google.com The URL of the remote or local site to be hosted.
PROXYHOST proxyserver1.mycompany.com The proxy server host name.
PROXYPORT 8000 The proxy server port.

IFrame Portlet Preferences

Name Example Value Description
SRC http://portals.apache.org/index.html
The URL of the remote or local site to be hosted.

You can use predefined variables, ${serverName}, ${serverPort} or ${contextPath}, to set local URLs.
So, if the requested server name is 'localhost', the requested server port is '8080' and the request context path is '/webcontent', then the following configurations are equivalent:

  • http://localhost:8080/webcontent/index.html
  • http://localhost:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/${contextPath}/index.html
AUTORESIZE true If this preference value is set to true, then this portlet tries to resize the height of the IFRAME tag based on the rendered content. However, this option is applied only when the 'SRC' url is in the same domain of the portal URL.
VISITLASTPAGE true If this preference value is set to true, then this last visited page in this portlet is stored in the session and the page will be revisited when the portlet is rendered again. However, this option is applied only when the 'SRC' url is in the same domain of the portal URL.
HEIGHT 300 The height of the IFrame window when in Normal Window State
WIDTH 100% The width of the IFrame window when in Normal Window State. Can be a percentage of available space to the portlet, or a constant value
MAX-HEIGHT 800 The height of the IFrame window when in Maximized Window State
MAX-WIDTH 100% The width of the IFrame window when in Maximized Window State. Can be a percentage of available space to the portlet, or a constant value
SCROLLING AUTO | YES | NO Specifies whether or not to display scrollbars in an iframe

ReverseProxyIFrame Portlet Preferences

Note: The ReverseProxyService should be able to access application level session attribute shared by a portlet of IFrameGenericPortlet or its descendant, which is conforming with the Portlet Specification. If you are using Tomcat, then be sure to set the following in the server.xml to enable this proper Portlet API session management requirements. Modify the Connector element (default on port 8080) by adding the folowing attribute:

emptySessionPath="true"
Name Example Value Description
SRC http://portals.apache.org/index.html The URL of the remote or local site to be hosted.

You can use predefined variables, ${serverName}, ${serverPort} or ${contextPath}, to set local URLs.
So, if the requested server name is 'localhost', the requested server port is '8080' and the request context path is '/webcontent', then the following configurations are equivalent:

  • http://localhost:8080/webcontent/index.html
  • http://localhost:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/${contextPath}/index.html
PROXYREMOTEURL http://portals.apache.org/ The base URL of the remote site. If 'PROXYREMOTEURL' and 'PROXYLOCALPATH' are set, then this portlet translates the 'SRC' url into a reverse proxy url by replacing the value of 'PROXYREMOTEURL' by the value of 'PROXYLOCALPATH'. If you use the default reverse proxy component, then you should configure the path mappings in the configuration file. (e.g., /WEB-INF/conf/reverseproxy.properties)

You can use predefined variables, ${serverName}, ${serverPort} or ${contextPath}, to set local URLs.
So, if the requested server name is 'localhost', the requested server port is '8080' and the request context path is '/webcontent', then the following configurations are equivalent:

  • http://localhost:8080/webcontent/index.html
  • http://localhost:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/webcontent/index.html
  • http://${serverName}:${serverPort}/${contextPath}/index.html
PROXYLOCALPATH ${contextPath}/rproxy/portals/ The base URL of the local proxy URL. If the value of 'PROXYLOCALPATH' doesn't starts with '/', then this portlet prepends the context path of the local servlet application. By default, this web application contains reverse proxy servlet mapped by '/rproxy' path. For some cases, you can use other external proxy server by setting a context relative path or absolute url such as '/apache' or 'http://www.localhost.com/apache'. If you use the default reverse proxy component, then you should configure the path mappings in the configuration file. (e.g., /WEB-INF/conf/reverseproxy.properties)

You can use the predefined variable, ${contextPath}, to set local paths.
So, if the request context path is '/webcontent', then the following configurations are equivalent:

  • /webcontent/rproxy/portals
  • ${contextPath}/rproxy/portals
AUTORESIZE true If this preference value is set to true, then this portlet tries to resize the height of the IFRAME tag based on the rendered content. However, this option is applied only when the 'SRC' url is in the same domain of the portal URL. Also, if 'PROXYREMOTEURL' and 'PROXYLOCALPATH' are set to use a proxy url in the same domain, then this option can be applied as well.
VISITLASTPAGE true If this preference value is set to true, then this last visited page in this portlet is stored in the session and the page will be revisited when the portlet is rendered again. However, this option is applied only when the 'SRC' url is in the same domain of the portal URL. Also, if 'PROXYREMOTEURL' and 'PROXYLOCALPATH' are set to use a proxy url in the same domain, then this option can be applied as well.
HEIGHT 300 The height of the IFrame window when in Normal Window State
WIDTH 100% The width of the IFrame window when in Normal Window State. Can be a percentage of available space to the portlet, or a constant value
MAX-HEIGHT 800 The height of the IFrame window when in Maximized Window State
MAX-WIDTH 100% The width of the IFrame window when in Maximized Window State. Can be a percentage of available space to the portlet, or a constant value
SCROLLING AUTO | YES | NO Specifies whether or not to display scrollbars in an iframe

For details on how to configure the Reverse Proxy Service, please refer to Introduction to Reverse Proxy Service.

Here are examples of the Web Content, IFrame and ReverseProxyIFrame Portlets: