Modified: portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/portlet.xml URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/portlet.xml?rev=816126&r1=816125&r2=816126&view=diff ============================================================================== --- portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/portlet.xml (original) +++ portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/portlet.xml Thu Sep 17 10:22:06 2009 @@ -1,120 +1,205 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at + <!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version + 2.0 (the "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> + http://www.apache.org/licenses/LICENSE-2.0 Unless required by + applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and + limitations under the License. + --> <portlet-app id='webcontent' - xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" - version="2.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> - - <portlet> - <description>Places an HTML IFrame inside a portlet for easily hosting other web application within a portlet. Sizes of both normal and maximized modes are configurable in edit mode.</description> - <portlet-name>IFramePortlet</portlet-name> - <display-name>IFrame Portlet</display-name> - <portlet-class>org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet</portlet-class> - <init-param> - <name>EditPage</name> - <value>/WEB-INF/view/edit-prefs.vm</value> - </init-param> - <init-param> - <name>HelpPage</name> - <value>/WEB-INF/view/iframe-help.html</value> - </init-param> - <init-param> - <name>portlet-icon</name> - <value>applications-internet.png</value> - </init-param> - <expiration-cache>300</expiration-cache> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>EDIT</portlet-mode> - <portlet-mode>VIEW</portlet-mode> - <portlet-mode>HELP</portlet-mode> - </supports> - <supported-locale>en</supported-locale> - <portlet-info> - <title>IFrame</title> - <short-title>IFrame</short-title> - <keywords>tool,iframe,web,frame,content,host</keywords> - </portlet-info> - <portlet-preferences> - <preference> - <name>SRC</name> - <value>http://portals.apache.org</value> - </preference> - <!-- Don't specify a HEIGHT if you want a normal filled out layout - because percentage values result in the content not to be displayed on IE6. - Specific values are ok though. - --> - <preference> - <name>HEIGHT</name> - <value>300</value> - </preference> - <preference> - <name>WIDTH</name> - <value>100%</value> - </preference> - <preference> - <name>MAX-HEIGHT</name> - <value>800</value> - </preference> - <preference> - <name>MAX-WIDTH</name> - <value>100%</value> - </preference> - <preference> - <name>SCROLLING</name> - <value>AUTO</value> - </preference> - </portlet-preferences> - </portlet> - - <portlet> - <description>Includes the content of another website inside the portal without using frames. All links are rewritten back to the portal to attempt to proxy all content through the portal.</description> - <portlet-name>WebContentPortlet</portlet-name> - <display-name>WebContent Portlet</display-name> - <portlet-class>org.apache.portals.applications.webcontent.portlet.WebContentPortlet</portlet-class> - <init-param> - <name>EditPage</name> - <value>/WEB-INF/view/edit-wcprefs.vm</value> - </init-param> - <init-param> - <name>portlet-icon</name> - <value>preferences-system-network-proxy.png</value> - </init-param> - <expiration-cache>-1</expiration-cache> - <supports> - <mime-type>text/html</mime-type> - <portlet-mode>EDIT</portlet-mode> - <portlet-mode>VIEW</portlet-mode> - </supports> - <supported-locale>en</supported-locale> - <portlet-info> - <title>WebContent Prototype</title> - <short-title>WebContent</short-title> - <keywords>web,content,webnav,bridge,proxy,rewrite</keywords> - </portlet-info> - <portlet-preferences> - <preference> - <name>SRC</name> - <value>http://www.google.com</value> - </preference> - </portlet-preferences> - </portlet> - + xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" + version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> + + <portlet> + <description>Places an HTML IFrame inside a portlet for easily + hosting other web application within a portlet. Sizes of both + normal and maximized modes are configurable in edit mode.</description> + <portlet-name>IFramePortlet</portlet-name> + <display-name>IFrame Portlet</display-name> + <portlet-class> + org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet</portlet-class> + <init-param> + <name>EditPage</name> + <value>/WEB-INF/view/edit-prefs.vm</value> + </init-param> + <init-param> + <name>HelpPage</name> + <value>/WEB-INF/view/iframe-help.html</value> + </init-param> + <init-param> + <name>portlet-icon</name> + <value>applications-internet.png</value> + </init-param> + <expiration-cache>300</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>EDIT</portlet-mode> + <portlet-mode>VIEW</portlet-mode> + <portlet-mode>HELP</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <portlet-info> + <title>IFrame</title> + <short-title>IFrame</short-title> + <keywords>tool,iframe,web,frame,content,host</keywords> + </portlet-info> + <portlet-preferences> + <preference> + <name>SRC</name> + <value>http://portals.apache.org/</value> + </preference> + <!-- You can set AUTORESIZE to true when the SRC is in the same domain of the portal web pages. --> + <preference> + <name>AUTORESIZE</name> + <value>false</value> + </preference> + <!-- + Don't specify a HEIGHT if you want a normal filled out layout + because percentage values result in the content not to be + displayed on IE6. Specific values are ok though. + --> + <preference> + <name>HEIGHT</name> + <value>300</value> + </preference> + <preference> + <name>WIDTH</name> + <value>100%</value> + </preference> + <preference> + <name>MAX-HEIGHT</name> + <value>800</value> + </preference> + <preference> + <name>MAX-WIDTH</name> + <value>100%</value> + </preference> + <preference> + <name>SCROLLING</name> + <value>AUTO</value> + </preference> + </portlet-preferences> + </portlet> + + <portlet> + <description>Places an HTML IFrame with reverse proxied url inside a portlet for easily + hosting other web application within a portlet. Sizes of both + normal and maximized modes are configurable in edit mode.</description> + <portlet-name>ReverseProxyIFramePortlet</portlet-name> + <display-name>ReverseProxy IFrame Portlet</display-name> + <portlet-class> + org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet</portlet-class> + <init-param> + <name>EditPage</name> + <value>/WEB-INF/view/edit-prefs.vm</value> + </init-param> + <init-param> + <name>HelpPage</name> + <value>/WEB-INF/view/iframe-help.html</value> + </init-param> + <init-param> + <name>portlet-icon</name> + <value>applications-internet.png</value> + </init-param> + <expiration-cache>300</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>EDIT</portlet-mode> + <portlet-mode>VIEW</portlet-mode> + <portlet-mode>HELP</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <portlet-info> + <title>ReverseProxyIFrame</title> + <short-title>ReverseProxyIFrame</short-title> + <keywords>tool,reverse,proxy,iframe,web,frame,content,host</keywords> + </portlet-info> + <portlet-preferences> + <preference> + <name>SRC</name> + <value>http://portals.apache.org/</value> + </preference> + <preference> + <name>PROXYREMOTEURL</name> + <value>http://portals.apache.org/</value> + </preference> + <preference> + <name>PROXYLOCALPATH</name> + <value>rproxy/portals/</value> + </preference> + <preference> + <name>AUTORESIZE</name> + <value>true</value> + </preference> + <!-- + Don't specify a HEIGHT if you want a normal filled out layout + because percentage values result in the content not to be + displayed on IE6. Specific values are ok though. + --> + <preference> + <name>HEIGHT</name> + <value>300</value> + </preference> + <preference> + <name>WIDTH</name> + <value>100%</value> + </preference> + <preference> + <name>MAX-HEIGHT</name> + <value>800</value> + </preference> + <preference> + <name>MAX-WIDTH</name> + <value>100%</value> + </preference> + <preference> + <name>SCROLLING</name> + <value>AUTO</value> + </preference> + </portlet-preferences> + </portlet> + + <portlet> + <description>Includes the content of another website inside the portal without using frames. All links are rewritten back to the portal to attempt to proxy all content through the portal.</description> + <portlet-name>WebContentPortlet</portlet-name> + <display-name>WebContent Portlet</display-name> + <portlet-class>org.apache.portals.applications.webcontent.portlet.WebContentPortlet</portlet-class> + <init-param> + <name>EditPage</name> + <value>/WEB-INF/view/edit-wcprefs.vm</value> + </init-param> + <init-param> + <name>portlet-icon</name> + <value>preferences-system-network-proxy.png</value> + </init-param> + <expiration-cache>-1</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>EDIT</portlet-mode> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <portlet-info> + <title>WebContent Prototype</title> + <short-title>WebContent</short-title> + <keywords>web,content,webnav,bridge,proxy,rewrite</keywords> + </portlet-info> + <portlet-preferences> + <preference> + <name>SRC</name> + <value>http://www.google.com</value> + </preference> + </portlet-preferences> + </portlet> + </portlet-app>
Modified: portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/web.xml?rev=816126&r1=816125&r2=816126&view=diff ============================================================================== --- portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/web.xml (original) +++ portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/WEB-INF/web.xml Thu Sep 17 10:22:06 2009 @@ -1,51 +1,74 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at + <!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version + 2.0 (the "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by + applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and + limitations under the License. + --> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + version="2.4" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + <display-name>Webcontent Portlet Application</display-name> <description>Apache Portals Applications: Webcontent PA</description> - <!-- for deploying on Websphere: disable Websphere default portletcontainer --> - <context-param> - <param-name>com.ibm.websphere.portletcontainer.PortletDeploymentEnabled</param-name> - <param-value>false</param-value> - </context-param> - - <!-- Define Velocity Servlet --> - <servlet> - <servlet-name>velocity</servlet-name> - <servlet-class>org.apache.portals.bridges.velocity.BridgesVelocityViewServlet</servlet-class> - <init-param> - <param-name>org.apache.velocity.toolbox</param-name> - <param-value>/WEB-INF/velocity/toolbox.xml</param-value> - </init-param> - <init-param> - <param-name>org.apache.velocity.properties</param-name> - <param-value>/WEB-INF/velocity/velocity.properties</param-value> - </init-param> - <load-on-startup>10</load-on-startup> - </servlet> - - <!-- Map *.vm files to Velocity --> - <servlet-mapping> - <servlet-name>velocity</servlet-name> - <url-pattern>*.vm</url-pattern> - </servlet-mapping> - + <!-- + for deploying on Websphere: disable Websphere default + portletcontainer + --> + <context-param> + <param-name> + com.ibm.websphere.portletcontainer.PortletDeploymentEnabled</param-name> + <param-value>false</param-value> + </context-param> + + <!-- Define Velocity Servlet --> + <servlet> + <servlet-name>velocity</servlet-name> + <servlet-class> + org.apache.portals.bridges.velocity.BridgesVelocityViewServlet</servlet-class> + <init-param> + <param-name>org.apache.velocity.toolbox</param-name> + <param-value>/WEB-INF/velocity/toolbox.xml</param-value> + </init-param> + <init-param> + <param-name>org.apache.velocity.properties</param-name> + <param-value>/WEB-INF/velocity/velocity.properties</param-value> + </init-param> + <load-on-startup>10</load-on-startup> + </servlet> + + <!-- Default Reverse Proxy Servlet --> + <servlet> + <servlet-name>ReverseProxyServlet</servlet-name> + <servlet-class> + org.apache.portals.applications.webcontent.proxy.impl.DefaultHttpReverseProxyServlet</servlet-class> + <init-param> + <param-name>reverseproxy.urlmappings</param-name> + <param-value>/WEB-INF/conf/reverseproxy-urlmappings.properties</param-value> + </init-param> + <load-on-startup>10</load-on-startup> + </servlet> + + <!-- Map *.vm files to Velocity --> + <servlet-mapping> + <servlet-name>velocity</servlet-name> + <url-pattern>*.vm</url-pattern> + </servlet-mapping> + + <!-- Map /rproxy path to the Default Reverse Proxy Servlet --> + <servlet-mapping> + <servlet-name>ReverseProxyServlet</servlet-name> + <url-pattern>/rproxy/*</url-pattern> + </servlet-mapping> + </web-app> Modified: portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_autoresize.js URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_autoresize.js?rev=816126&r1=816125&r2=816126&view=diff ============================================================================== --- portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_autoresize.js (original) +++ portals/applications/webcontent/trunk/webcontent-war/src/main/webapp/javascript/iframe_autoresize.js Thu Sep 17 10:22:06 2009 @@ -15,41 +15,44 @@ limitations under the License. */ function iframePortlet_resetHeight(iframe, bindEvent) { + try { if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight) { - iframe.height = iframe.contentDocument.body.offsetHeight + 16; + iframe.height = iframe.contentDocument.body.offsetHeight + 16; } else if (iframe.Document && iframe.Document.body.scrollHeight) { - iframe.height = iframe.Document.body.scrollHeight; + iframe.height = iframe.Document.body.scrollHeight; } if (bindEvent) { - if (window.addEventListener) { - iframe.addEventListener("load", iframePortlet_iframeOnLoad, false); - } else if (window.attachEvent) { - iframe.detachEvent("onload", iframePortlet_iframeOnLoad);; - iframe.attachEvent("onload", iframePortlet_iframeOnLoad); - } + if (window.addEventListener) { + iframe.addEventListener("load", iframePortlet_iframeOnLoad, false); + } else if (window.attachEvent) { + iframe.detachEvent("onload", iframePortlet_iframeOnLoad);; + iframe.attachEvent("onload", iframePortlet_iframeOnLoad); + } } + } catch (e) { + } } function iframePortlet_iframeOnLoad(evt) { - var iframe = (window.event ? window.event.srcElement : evt.currentTarget); - if (iframe) { - iframePortlet_resetHeight(iframe, false); - } + var iframe = (window.event ? window.event.srcElement : evt.currentTarget); + if (iframe) { + iframePortlet_resetHeight(iframe, false); + } } var iframePortlet_iframesContainerOnLoad_working = false; function iframePortlet_iframesContainerOnLoad() { - if (iframePortlet_iframesContainerOnLoad_working) return; - iframePortlet_iframesContainerOnLoad_working = true; - var iframes = document.getElementsByTagName("IFRAME"); - for (var i = 0; i < iframes.length; i++) { - var autoResize = "" + iframes[i].getAttribute("autoresize"); - if (autoResize.match(/^(true)|(yes)|(on)$/i)) { - iframePortlet_resetHeight(iframes[i], true); - } + if (iframePortlet_iframesContainerOnLoad_working) return; + iframePortlet_iframesContainerOnLoad_working = true; + var iframes = document.getElementsByTagName("IFRAME"); + for (var i = 0; i < iframes.length; i++) { + var autoResize = "" + iframes[i].getAttribute("autoresize"); + if (autoResize.match(/^(true)|(yes)|(on)$/i)) { + iframePortlet_resetHeight(iframes[i], true); } - iframePortlet_iframesContainerOnLoad_working = false; + } + iframePortlet_iframesContainerOnLoad_working = false; } if (window.addEventListener) { - window.addEventListener("load", iframePortlet_iframesContainerOnLoad, false); + window.addEventListener("load", iframePortlet_iframesContainerOnLoad, false); } else if (window.attachEvent) { - window.attachEvent("onload", iframePortlet_iframesContainerOnLoad) + window.attachEvent("onload", iframePortlet_iframesContainerOnLoad) }
