You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@portals.apache.org by wo...@apache.org on 2014/11/21 14:10:53 UTC

svn commit: r1640913 - in /portals/site/applications/src/site: resources/images/simplereverseproxy.png xdoc/webcontent2/war-module.xml

Author: woonsan
Date: Fri Nov 21 13:10:52 2014
New Revision: 1640913

URL: http://svn.apache.org/r1640913
Log:
APA-67: describing war-module.

Added:
    portals/site/applications/src/site/resources/images/simplereverseproxy.png   (with props)
Modified:
    portals/site/applications/src/site/xdoc/webcontent2/war-module.xml

Added: portals/site/applications/src/site/resources/images/simplereverseproxy.png
URL: http://svn.apache.org/viewvc/portals/site/applications/src/site/resources/images/simplereverseproxy.png?rev=1640913&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/site/applications/src/site/resources/images/simplereverseproxy.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: portals/site/applications/src/site/xdoc/webcontent2/war-module.xml
URL: http://svn.apache.org/viewvc/portals/site/applications/src/site/xdoc/webcontent2/war-module.xml?rev=1640913&r1=1640912&r2=1640913&view=diff
==============================================================================
--- portals/site/applications/src/site/xdoc/webcontent2/war-module.xml (original)
+++ portals/site/applications/src/site/xdoc/webcontent2/war-module.xml Fri Nov 21 13:10:52 2014
@@ -25,11 +25,76 @@
   <body>
 
     <section name="WAR Module">
-      <p>TODO</p>
+      <p>
+        The Web Content Application 2 WAR Module packages all the other modules
+        with default servlet/filter/portlet configurations and demonstration-purpose examples.
+      </p>
     </section>
 
-    <section name="Reverse Proxy Servlet Definitions">
-      <p>TODO</p>
+    <section name="Default Reverse Proxy Servlet/Filter Definition(s)">
+      <p>
+        The Web Content Application 2 WAR Module contains a reverse proxy servlet definition
+        like the following in /WEB-INF/web.xml by default.
+      </p>
+
+      <source><![CDATA[
+  <!-- Default Reverse Proxy Servlet -->
+  <servlet>
+    <servlet-name>ReverseProxyServlet</servlet-name>
+    <servlet-class>org.apache.portals.applications.webcontent2.proxy.servlet.SimpleReverseProxyServlet</servlet-class>
+    <init-param>
+      <param-name>mappings</param-name>
+      <param-value>
+        /WEB-INF/rproxy-mappings.yaml
+      </param-value>
+    </init-param>
+  </servlet>
+
+  <!-- Map /rproxy path to the Default Reverse Proxy Servlet -->
+  <servlet-mapping>
+    <servlet-name>ReverseProxyServlet</servlet-name>
+    <url-pattern>/rproxy/*</url-pattern>
+  </servlet-mapping>
+      ]]></source>
+
+      <p>
+        The mapping configuration for the servlet is configured in <code>/WEB-INF/rproxy-mappings.yaml</code> by default:
+      </p>
+      <source><![CDATA[
+--- !regex
+localPattern: ^/localhost_(\d+)/(.*)$
+remoteReplace: http://localhost:$1/$2
+remotePattern: ^http://localhost:(\d+)/(.*)$
+localReplace: /localhost_$1/$2
+contentRewriters:
+    text/html: !!org.apache.portals.applications.webcontent2.proxy.rewriter.DefaultReverseProxyTextLineContentRewriter []
+
+--- !simple
+local: /portals/applications/
+remote: http://portals.apache.org/applications/
+contentRewriters:
+    text/html: !!org.apache.portals.applications.webcontent2.proxy.rewriter.DefaultReverseProxyTextLineContentRewriter []
+
+--- !simple
+local: /portals/bridges/
+remote: http://portals.apache.org/bridges/
+contentRewriters:
+    text/html: !!org.apache.portals.applications.webcontent2.proxy.rewriter.DefaultReverseProxyTextLineContentRewriter []
+
+--- !regex
+localPattern: ^/apache/(\w+)/(.*)$
+remoteReplace: http://$1.apache.org/$2
+remotePattern: ^http://(\w+)\.apache\.org/(.*)$
+localReplace: /apache/$1/$2
+contentRewriters:
+    text/html: !!org.apache.portals.applications.webcontent2.proxy.rewriter.DefaultReverseProxyTextLineContentRewriter []
+
+--- !simple
+local: /
+remote: http://apache.org/
+contentRewriters:
+    text/html: !!org.apache.portals.applications.webcontent2.proxy.rewriter.DefaultReverseProxyTextLineContentRewriter []
+      ]]></source>
     </section>
 
     <section name="Portlet Definitions">
@@ -38,29 +103,30 @@
         The Web Content Application 2 WAR Module contains several portlet definitions
         in /WEB-INF/portlet.xml:
         <ul>
-          <li>IFrame Portlet</li>
-          <li>ReverseProxy IFrame Portlet</li>
-          <li>Web Content Portlet</li>
+          <li>IFrame Portlet 2</li>
+          <li>ReverseProxy IFrame Portlet 2</li>
+          <li>Web Content Portlet 2</li>
+          <li>SimpleReverseProxyPortlet</li>
         </ul>
         All the portlets host content from a different website or local
         servlet inside a portlet window. 
       </p>
       <p>
-        The IFrame Portet achieves this
+        The IFrame Portet 2 achieves this
         by embedding an HTML
         <a href="http://en.wikipedia.org/wiki/HTML_element#Frames">iframe</a>
         within a portlet.
       </p>
       <p>
-        The ReverseProxy IFrame Portlet behaves in the same way as IFrame Portlet does,
-        except that it uses <a href="rproxy.html">Reverse Proxy Service</a> URLs
+        The ReverseProxy IFrame Portlet 2 behaves in the same way as IFrame Portlet 2 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.
       </p>
       <p>
-        The Web Content portlet takes a more complicated approach: it actually
+        The Web Content Portlet 2 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
@@ -70,8 +136,14 @@
         always work correctly.
       </p>
       <p>
+        The SimpleReverseProxyPortlet behaves in the same way as Reverse Proxy Servlet or Filter by itself
+        without having to depend on an external reverse proxy servlet or filter.
+        This portlet also rewrite all the links to portlet action URLs like Web Content Portlet 2 does.
+        This simple reverse proxying portlet can be used as a base class that you can extend or as an example.
+      </p>
+      <p>
         If you are interested in secure versions of these portlets, see
-        the Jetspeed-specific versions of the IFrame, ReverseProxyIFrame, or WebContent
+        the Jetspeed-specific versions of the IFrame 2, ReverseProxyIFrame 2, or WebContent 2
         portlets found at the
         <a href='http://portals.apache.org/jetspeed-2/applications/j2-admin.html'>Jetspeed J2-Admin</a>
         website.
@@ -80,49 +152,55 @@
       </p>
       <p>Here are the classes to declare when using the portlets:</p>
       <source><![CDATA[
-<portlet-class>org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet</portlet-class>        
+<portlet-class>org.apache.portals.applications.webcontent2.portlet.IFrameGenericPortlet</portlet-class>        
       ]]></source>
       <p>
         <em>Note: The ReverseProxyIFramePortlet uses the same class, but has different preferences configurations.</em>
       </p>
       <p>or</p>
       <source><![CDATA[
-<portlet-class>org.apache.portals.applications.webcontent.portlet.WebContentPortlet</portlet-class>        
+<portlet-class>org.apache.portals.applications.webcontent2.portlet.WebContentPortlet</portlet-class>        
       ]]></source>
-      <subsection name='Web Content Portlet Preferences'>
+      <subsection name='Web Content Portlet Preferences or Init Parameters'>
         <table>
           <tr>
             <th>Name</th>
+            <th>Type</th>
             <th>Example Value</th>
             <th>Description</th>
           </tr>
           <tr>
             <td>SRC</td>
+            <td>Preference</td>
             <td>http://www.google.com</td>
             <td>The URL of the remote or local site to be hosted.
             </td>
           </tr>
           <tr>
             <td>PROXYHOST</td>
+            <td>Preference</td>
             <td>proxyserver1.mycompany.com</td>
             <td>The proxy server host name.</td>
           </tr>
           <tr>
             <td>PROXYPORT</td>
+            <td>Preference</td>
             <td>8000</td>
             <td>The proxy server port.</td>
           </tr>
         </table>
       </subsection>
-      <subsection name='IFrame Portlet Preferences'>
+      <subsection name='IFrame Portlet Preferences or Init Parameters'>
         <table>
           <tr>
             <th>Name</th>
+            <th>Type</th>
             <th>Example Value</th>
             <th>Description</th>
           </tr>
           <tr>
             <td>SRC</td>
+            <td>Preference</td>
             <td>
               http://portals.apache.org/index.html<br/>
             </td>
@@ -144,6 +222,7 @@
           </tr>
           <tr>
             <td>AUTORESIZE</td>
+            <td>Preference</td>
             <td>true</td>
             <td>
               If this preference value is set to true, then
@@ -153,6 +232,7 @@
           </tr>
           <tr>
             <td>VISITLASTPAGE</td>
+            <td>Preference</td>
             <td>true</td>
             <td>
               If this preference value is set to true, then
@@ -163,32 +243,37 @@
           </tr>
           <tr>
             <td>HEIGHT</td>
+            <td>Preference</td>
             <td>300</td>
             <td>The height of the IFrame window when in Normal Window State</td>
           </tr>
           <tr>
             <td>WIDTH</td>
+            <td>Preference</td>
             <td>100%</td>
             <td>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</td>
           </tr>
           <tr>
             <td>MAX-HEIGHT</td>
+            <td>Preference</td>
             <td>800</td>
             <td>The height of the IFrame window when in Maximized Window State</td>
           </tr>
           <tr>
             <td>MAX-WIDTH</td>
+            <td>Preference</td>
             <td>100%</td>
             <td>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</td>
           </tr>
           <tr>
             <td>SCROLLING</td>
+            <td>Preference</td>
             <td>AUTO | YES | NO</td>
             <td>Specifies whether or not to display scrollbars in an iframe</td>
           </tr>
         </table>
       </subsection>
-      <subsection name='ReverseProxyIFrame Portlet Preferences'>
+      <subsection name='ReverseProxyIFrame Portlet Preferences or Init Parameters'>
         <p>
           <em>
             Note: The ReverseProxyService should be able to access application level session attribute
@@ -203,11 +288,13 @@
         <table>
           <tr>
             <th>Name</th>
+            <th>Type</th>
             <th>Example Value</th>
             <th>Description</th>
           </tr>
           <tr>
             <td>SRC</td>
+            <td>Preference</td>
             <td>http://portals.apache.org/index.html</td>
             <td>
               The URL of the remote or local site to be hosted.
@@ -227,6 +314,7 @@
           </tr>
           <tr>
             <td>PROXYREMOTEURL</td>
+            <td>Preference</td>
             <td>http://portals.apache.org/</td>
             <td>
               The base URL of the remote site.
@@ -251,6 +339,7 @@
           </tr>
           <tr>
             <td>PROXYLOCALPATH</td>
+            <td>Preference</td>
             <td>${contextPath}/rproxy/portals/</td>
             <td>
               The base URL of the local proxy URL.
@@ -275,6 +364,7 @@
           </tr>
           <tr>
             <td>AUTORESIZE</td>
+            <td>Preference</td>
             <td>true</td>
             <td>
               If this preference value is set to true, then
@@ -286,6 +376,7 @@
           </tr>
           <tr>
             <td>VISITLASTPAGE</td>
+            <td>Preference</td>
             <td>true</td>
             <td>
               If this preference value is set to true, then
@@ -298,44 +389,104 @@
           </tr>
           <tr>
             <td>HEIGHT</td>
+            <td>Preference</td>
             <td>300</td>
             <td>The height of the IFrame window when in Normal Window State</td>
           </tr>
           <tr>
             <td>WIDTH</td>
+            <td>Preference</td>
             <td>100%</td>
             <td>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</td>
           </tr>
           <tr>
             <td>MAX-HEIGHT</td>
+            <td>Preference</td>
             <td>800</td>
             <td>The height of the IFrame window when in Maximized Window State</td>
           </tr>
           <tr>
             <td>MAX-WIDTH</td>
+            <td>Preference</td>
             <td>100%</td>
             <td>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</td>
           </tr>
           <tr>
             <td>SCROLLING</td>
+            <td>Preference</td>
             <td>AUTO | YES | NO</td>
             <td>Specifies whether or not to display scrollbars in an iframe</td>
           </tr>
         </table>
-        <p>
-          For details on how to configure the Reverse Proxy Service, please refer to <a href="rproxy.html">Introduction to Reverse Proxy Service</a>.
-        </p>
-        
+      </subsection>
+      <subsection name='SimpleReverseProxyPortlet Preferences or Init Parameters'>
+        <table>
+          <tr>
+            <th>Name</th>
+            <th>Type</th>
+            <th>Example Value</th>
+            <th>Description</th>
+          </tr>
+          <tr>
+            <td>remote.uri</td>
+            <td>Preference, Request Parameter or Init Parameter</td>
+            <td>http://portals.apache.org/news.html</td>
+            <td>
+              The remote URL to be served through the internal reverse proxy components.
+            </td>
+          </tr>
+          <tr>
+            <td>xpath.expression</td>
+            <td>Init Parameter</td>
+            <td>//div[@id='bodyColumn']</td>
+            <td>
+              The XPath expression string which is used by the internal reverse proxy components
+              (using HtmlCleaner library)
+              after retrieving the remote content in order to extract only the portion filtered by
+              this XPath expression.
+            </td>
+          </tr>
+          <tr>
+            <td>html.cleaner.transformation</td>
+            <td>Init Parameter</td>
+            <td>
+              <pre>cfoutput |
+c:block=div,false |
+font=span,true |
+font.size |
+font.face |
+font.style=${style};font-family=${face};font-size=${size};</pre>
+            </td>
+            <td>
+              HtmlCleaner transformation setting configurations,
+              separated by '|'.
+              <br/>
+              For detail, see <a href="http://htmlcleaner.sourceforge.net/parameters.php" target="_blank">http://htmlcleaner.sourceforge.net/parameters.php</a>.
+            </td>
+          </tr>
+        </table>
       </subsection>
 
-      <p>Here are examples of the Web Content, IFrame and ReverseProxyIFrame Portlets:</p>
-      <br/>
+      <p>Here are examples of the Web Content, IFrame, ReverseProxyIFrame and SimpleReverseProxy Portlets:</p>
+
+      <p> </p>
+
       <img src='../images/wc.png'/>
-      <br/>
+
+      <p> </p>
+
       <img src='../images/iframe.png'/>
-      <br/>
+
+      <p> </p>
+
       <img src='../images/rproxyif.png'/>
 
+      <p> </p>
+
+      <img src='../images/simplereverseproxy.png'/>
+
+      <p> </p>
+
     </section>
 
   </body>