Web Proxy Portlet

Introduction #

The Web Proxy portlet allows showing any website (or any content accessible using HTTP) as if it was a portlet. It's based on the Portlet Bridge project (http://www.portletbridge.org/) version 1.1.2.

Features #

The following features are provided thanks to the portlet bridge project:

  • Getting content from a downstream site
  • Proxy configuration (including NTLM and Basic authentication)
  • NTLM and Basic authentication as preferences
  • Using an xsl stylesheet to rewrite the content from the downstream site
  • Proxying of remote resources (e.g. images, flash etc.)
  • Regular expression defining which URL's are in the portlet and which should be regular links
  • XSL Stylesheets packaged as part of the portlet or remote (URL based)
  • Links to binary files
  • Rewriting CSS urls
  • Moving javascript and css links out of the head
  • Hiding of downstream URLs and configurable scope
  • Back button and refresh support
  • Base tag support
  • Pluggable authentication
  • Configurable regular expressions for Javascript and CSS rewriting

Source: http://www.portletbridge.org/features.html

The Liferay Portal integration adds the following on top of this:

  • Configuration through the Web UI of:
    • URL of the remote site/content
    • Scope of links to be rewritten
    • Proxy configuration
    • XSL to transform the content

Deploying the web proxy portlet #

The portlet is already installed on standard installations.

Have a look at the "Sample" category.

Deploying portlet bridge manually #

Some times it might be desired to install portlet bridge manually instead of using the Web Proxy portlet provided by Liferay. This could be the case if you have modified the source code or if there is a newer version than the one provided by Liferay.

While portletbridge comes prepared to be installed in Liferay it's not been adapted to its latest version, so there are a few extra steps needed. Note that you may need to change the version numbers used below to correspond to the ones of the version of Liferay you are using:

1. Download the .war file and extract its content to some folder, eg with:

 jar xvf portletbridge-portlet.war

2. Modify WEB-INF/liferay-display.xml by changing the DTD from

 <!DOCTYPE display PUBLIC "-//Liferay//DTD DISPLAY 2.0.0//EN" "http://www.liferay.com/dtd/liferay-display_2_0_0.dtd">


 <!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "http://www.liferay.com/dtd/liferay-display_4_0_0.dtd">
 <!--<!DOCTYPE display PUBLIC "-//Liferay//DTD DISPLAY 2.0.0//EN" "http://www.liferay.com/dtd/liferay-display_2_0_0.dtd">-->

3. Modify WEB-INF/liferay-portlet.xml by changing the DTD from

 <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 3.5.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_3_5_0.dtd">


 <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_3_0.dtd">
 <!--<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 3.5.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_3_5_0.dtd">-->

4. Repackage all the content with the modified files, eg through:

 jar cvf portletbridge-portlet.war *

5. Deploy the .war file onto liferay

Note: the jar command is an executable that comes with your Java VM, you may need to install a Java SDK to make that program available to you.

Configuration #

Enter the URL that the portlet shall show as default.

The scope is a regular expression matched to the absolute URL of the target of a link. If the expression matches, the link is rewritten such that the request goes to the proxy portlet, and the next page would show up inside the portlet. If the expression does not match, the link is not rewritten, so the browser would get the original link and may show the next page without using the proxy portlet and portal. If the browser cannot access the referenced page without a proxy inbetween following that link is impossible (and maybe that is what you want).

You may enter an XSL-T stylesheet (no url or filename, the stylesheet itself) if you want the pages to be processed while the content is proxied. You can use this if e.g. you want to hide some parts (e.g. remove all the links that cannot be followed through the proxy anyway).

References #

The Web Proxy Portlet is one of Liferay's Out of The Box Portlets

0 Anexos
110950 Visualizações
Média (2 Votos)
A média da avaliação é 4.0 estrelas de 5.
Respostas do tópico Autor Data
hullo, i've tried the web proxy portlet but it... demonz elevenb 23 de Fevereiro de 2012 13:54
Hi, it doesn't work for Liferay 6.2 maher megadmini 17 de Outubro de 2014 07:44

hullo, i've tried the web proxy portlet but it refused to work. I just added the URL of an existing webapp and nothing shows up. (strangely, http://www.google.com works)

However, with the "iframe" plugin, things work fine.

any suggestions?
Postado em 23/02/12 13:54.

it doesn't work for Liferay 6.2
Postado em 17/10/14 07:44.