Forums

Home » Liferay Portal » English » 3. Development »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tobias Hofmann
Web Proxy
August 7, 2008 10:58 AM
Answer

Tobias Hofmann

Rank: Junior Member

Posts: 81

Join Date: June 20, 2007

Recent Posts

Hi,

I've a serious problem with the Web Proxy portlet. I try to use this portlet to integrate an SAP iView. The Web Proxy portlet accesses the iView using an unknown user agent.

Error message:
iView is not compatible with your browser, operating system or device. Contact your system administrator.

In the log I get the following:
WARN  [BridgeViewPortlet:1111] no bridge request found for null


Does this error mean, that the Web Proxy Portlet is sending an unknown Browser ID? On the SAP side, the iView is configured to accept IE and Mozilla. How do I change the ID the Web Proxy is sending? Where can I insert something like "Internet Explorer"?
Does anybody ever tried successfully to integrate an SAP iView with the Web Proxy?

br,
Tobias
Eric Devlin
RE: Web Proxy
August 7, 2008 11:56 AM
Answer

Eric Devlin

Rank: Regular Member

Posts: 154

Join Date: February 19, 2008

Recent Posts

Hey,
I'm not familiar with iView, but if you can get it at through an http request and it returns html, it should work. I had to modify WebProxy to work with a post on liferay. I got IBM HATS to run under it but I had to modify the stylesheet using the portlet configuration. I'd be leary of anything that used javascript to modify links. This was also all done under liferay 4.4.2.
Eric

Change Details
Tobias Hofmann
RE: Web Proxy
August 7, 2008 1:15 PM
Answer

Tobias Hofmann

Rank: Junior Member

Posts: 81

Join Date: June 20, 2007

Recent Posts

Hi,

thanks for your tip, but it looks like the iView is recieving an invalid browser ID and is not sending any HTML back to the Web Proxy Portlet. I think this is also the reason that the I get the Warning from the portletbrdge component. No HTML content to show, therefor: Null.

So, how do I change the browser ID from the Web Proxy Portlet to something an SAP iView will recognize and send HTML traffic?

br,
Tobias
Eric Devlin
RE: Web Proxy
August 8, 2008 7:16 AM
Answer

Eric Devlin

Rank: Regular Member

Posts: 154

Join Date: February 19, 2008

Recent Posts

Hey,
The PortletBridgeServlet.java copies the headers including the user-agent. You can always get the source and uncomment System.out.println in copyRequestHeaders just to validate. What is the url you are using?
Eric
Tobias Hofmann
RE: Web Proxy
August 8, 2008 11:48 AM
Answer

Tobias Hofmann

Rank: Junior Member

Posts: 81

Join Date: June 20, 2007

Recent Posts

Hi,

the Web Proxy isn't parsing the client header information.
I redirected the URL to an Apache Reverse Proxy, and in the Apache Log I get:
Jakarta Commons-HttpClient/3.1


Why would someone rewrite the client header information???? And why is this not a configuration parameter that I can define in the portlet preferences?

I think I will try to use Apache to rewrite the client header to match IE 6.

br,
Tobias
artur versiani varella
RE: Web Proxy
October 1, 2009 2:27 PM
Answer

artur versiani varella

Rank: New Member

Posts: 10

Join Date: September 11, 2009

Recent Posts

Hey Eric,

I guess I am facing the same problem you fought in the past. I have what I think is a HATS IBM application and want to automatically login-in the application.

The problem is that the hats application doesn't allow me to just submit the form directly, it needs though to create its session variables before.

Well, I reckon using webproxy could be an excellent solution, but I can't get it to work properly. To be more specifically, I can't get a post form to work with those errors being thrown:

no bridge request found for null
No bridge request, URL=/pbhs

Well, I am not sure if I continue that way, trying to get and modify portlet-bridges sources, etc... I'm also not sure which sources to use, where to get them, as it seems the war file is quite old.

Any Ideas?

Cheers and thanks in advance,
Artur
Eric Devlin
RE: Web Proxy
October 2, 2009 9:49 AM
Answer

Eric Devlin

Rank: Regular Member

Posts: 154

Join Date: February 19, 2008

Recent Posts

Hey Artur,
Did you set the url in the configuration? Mine is http://172.17.0.44/HATS which is behind the firewall. The style sheet I used is below. This link and this other link maybe of some help when you get ready to prepopulate the credentials and auto submit the form.
Eric

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bridge="java:org.portletbridge.portlet.BridgeFunctions"
extension-element-prefixes="bridge">

<!-- @author rickard -->
<!-- @author jamie -->

<xsl:output method="html"
encoding="UTF-8"
indent="yes"
standalone="no"
omit-xml-declaration="yes"/>

<xsl:param name="bridge"/>
<xsl:variable name="base" select="/HTML/HEAD/BASE/@href"/>

<!-- Fetch some info from head, and all of body -->
<xsl:template match="/HTML">
<xsl:apply-templates select="HEAD"/>
<xsl:apply-templates select="BODY"/>
</xsl:template>

<xsl:template match="/HTML/HEAD">
<xsl:apply-templates select="STYLE"/>
<xsl:apply-templates select="LINK[bridge:equalsIgnoreCase($bridge, @rel, 'stylesheet') and (not(@media) or (@media != 'print' and @media != 'handheld'))]"/>
<xsl:apply-templates select="SCRIPT"/>
<xsl:apply-templates select="TITLE"/>

</xsl:template>

<xsl:template match="/HTML/HEAD/TITLE">
<xsl:value-of select="bridge:setTitle($bridge, text())"/>
</xsl:template>

<xsl:template match="/HTML/BODY">
<DIV>
<xsl:attribute name="class">
<xsl:value-of select="@class"/>
</xsl:attribute>
<SCRIPT>
<xsl:value-of select="@onload"/>
</SCRIPT>
<xsl:apply-templates select="node()"/>
<script>

//Eric
<xsl:text>appletActiveImage = "</xsl:text><xsl:value-of select="bridge:link($bridge, $base, '../common/images/appletActive.gif' )"/><xsl:text>";</xsl:text>
<xsl:text>autoAdvanceIndicatorImage = "</xsl:text><xsl:value-of select="bridge:link($bridge, $base, '../common/images/autoAdvance.gif' )"/><xsl:text>";</xsl:text>
<xsl:text>inputInhibitedImage = "</xsl:text><xsl:value-of select="bridge:link($bridge, $base, '../common/images/inputInhibited.gif' )"/><xsl:text>";</xsl:text>
<xsl:text>insertModeImage = "</xsl:text><xsl:value-of select="bridge:link($bridge, $base, '../common/images/insertMode.gif' )"/><xsl:text>";</xsl:text>
<xsl:text>overwriteModeImage = "</xsl:text><xsl:value-of select="bridge:link($bridge, $base, '../common/images/overwriteMode.gif' )"/><xsl:text>";</xsl:text>

<xsl:text>setInitHatsFocus('HATSForm');</xsl:text>
</script>
</DIV>
</xsl:template>

<!-- Rewrite links -->
<xsl:template match="A/@href">
<xsl:attribute name="href">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<xsl:template match="A/@onclick">
<xsl:attribute name="onclick">
<xsl:value-of select="bridge:script($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Rewrite script links -->
<xsl:template match="SCRIPT/@src">
<xsl:attribute name="src">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Rewrite image references -->
<xsl:template match="IMG/@src">
<xsl:attribute name="src">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<xsl:template match="INPUT/@src">
<xsl:attribute name="src">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Rewrite imagemap references -->
<xsl:template match="MAP/AREA/@href">
<xsl:attribute name="href">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Copy style tags from head -->
<xsl:template match="/HTML/HEAD/STYLE">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:value-of select="bridge:style($bridge, $base, .)"/>
</xsl:copy>
</xsl:template>

<xsl:template match="@style">
<xsl:attribute name="style">
<xsl:value-of select="bridge:style($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Copy script tags from head -->
<xsl:template match="/HTML/HEAD/SCRIPT[@src]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="src">
<xsl:value-of select="bridge:link($bridge, $base, @src)"/>
</xsl:attribute>
</xsl:copy>
</xsl:template>

<xsl:template match="/HTML/HEAD/SCRIPT/text()">
<xsl:value-of select="bridge:script($bridge, $base, .)"/>
</xsl:template>

<!-- Convert link tags in head to style tags -->
<xsl:template match="/HTML/HEAD/LINK">
<STYLE type="text/css">@import "<xsl:value-of select="bridge:link($bridge, $base, @href)"/>";</STYLE>
</xsl:template>

<xsl:template match="FORM/@action">
<xsl:attribute name="action">
<xsl:value-of select="bridge:link($bridge, $base, .)"/>
</xsl:attribute>
</xsl:template>

<!-- Identity template -->
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>