portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1621401 - /portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java
Date Sat, 30 Aug 2014 00:25:26 GMT
Author: woonsan
Date: Sat Aug 30 00:25:25 2014
New Revision: 1621401

URL: http://svn.apache.org/r1621401
Log:
adding extensible methods for jetspeed admin webcontent portlets

Modified:
    portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java

Modified: portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java?rev=1621401&r1=1621400&r2=1621401&view=diff
==============================================================================
--- portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java
(original)
+++ portals/applications/webcontent/trunk/portlets/src/main/java/org/apache/portals/applications/webcontent2/portlet/WebContentPortlet.java
Sat Aug 30 00:25:25 2014
@@ -42,6 +42,7 @@ import javax.portlet.ActionResponse;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
 import javax.portlet.PortletURL;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
@@ -70,9 +71,10 @@ import org.apache.http.impl.client.HttpC
 import org.apache.http.impl.client.LaxRedirectStrategy;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
-import org.apache.portals.applications.webcontent2.portlet.history.WebContentPageHistory;
 import org.apache.portals.applications.webcontent2.portlet.history.WebContentPage;
+import org.apache.portals.applications.webcontent2.portlet.history.WebContentPageHistory;
 import org.apache.portals.applications.webcontent2.portlet.rewriter.MappingRewriterController;
+import org.apache.portals.applications.webcontent2.portlet.rewriter.Rewriter;
 import org.apache.portals.applications.webcontent2.portlet.rewriter.RewriterController;
 import org.apache.portals.applications.webcontent2.portlet.rewriter.RewriterException;
 import org.apache.portals.applications.webcontent2.portlet.rewriter.RulesetRewriter;
@@ -328,7 +330,7 @@ public class WebContentPortlet extends G
             if (rewriterController == null)
             {
                 String webinfDirPath = getPortletContext().getRealPath("/WEB-INF") + "/";
-                rewriterController = getRewriterController(webinfDirPath, WebContentRewriter.class);
+                rewriterController = getRewriterController(webinfDirPath);
             }
 
             if (rewriterRuleSet == null)
@@ -346,7 +348,7 @@ public class WebContentPortlet extends G
                 }
             }
 
-            WebContentRewriter rewriter = (WebContentRewriter) createRewriter(rewriterController,
rewriterRuleSet);
+            WebContentRewriter rewriter = (WebContentRewriter) createRewriter(request, rewriterController,
rewriterRuleSet);
 
             // Set the action and base URLs in the rewriter
             PortletURL action = response.createActionURL();
@@ -575,9 +577,9 @@ public class WebContentPortlet extends G
     /*
      * Generate a rewrite controller using the basic rules file
      */
-    protected RewriterController getRewriterController(String contextPath, Class rewriterClass)
throws Exception
+    protected RewriterController getRewriterController(String contextPath) throws Exception
     {
-        Class[] rewriterClasses = new Class[] { rewriterClass, rewriterClass };
+        Class[] rewriterClasses = new Class[] { WebContentRewriter.class, WebContentRewriter.class
};
         Class[] adaptorClasses = new Class[] { NekoParserAdaptor.class, SaxParserAdaptor.class
};
         RewriterController rewriterController = 
                         new MappingRewriterController(contextPath + "conf/rewriter-rules-mapping.xml",

@@ -586,7 +588,7 @@ public class WebContentPortlet extends G
         return rewriterController;
     }
 
-    protected RulesetRewriter createRewriter(RewriterController rewriterController, Ruleset
ruleset) throws RewriterException
+    protected Rewriter createRewriter(PortletRequest request, RewriterController rewriterController,
Ruleset ruleset) throws RewriterException
     {
         RulesetRewriter rewriter = rewriterController.createRewriter(ruleset);
         return rewriter;
@@ -601,7 +603,7 @@ public class WebContentPortlet extends G
                         .setRedirectStrategy(new LaxRedirectStrategy());
 
         String proxyHost = StringUtils.trim(request.getPreferences().getValue("PROXYHOST",
defaultProxyHost));
-        int proxyPort = NumberUtils.toInt(request.getPreferences().getValue("PROXYPORT",
""), -1);
+        int proxyPort = NumberUtils.toInt(request.getPreferences().getValue("PROXYPORT",
Integer.toString(defaultProxyPort)), -1);
 
         if (!StringUtils.isEmpty(proxyHost))
         {



Mime
View raw message