[portal-commits] JBoss Portal SVN: r8811 - in branches/JBoss_Portal_Branch_2_6: faces/src/main/org/jboss/portal/faces/component/portlet and 5 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Thu Nov 1 01:18:04 EDT 2007


Author: chris.laprun at jboss.com
Date: 2007-11-01 01:18:03 -0400 (Thu, 01 Nov 2007)
New Revision: 8811

Modified:
   branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java
   branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java
   branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
   branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
   branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java
   branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
- Made RemoteSOAPInvokerServiceFactory use URLTools since it got broken due to the use of snapshot of common in thirdparty (it was depending on URLStreamOpeningThread that got removed).
- Adapted code to refactorings in FastURLEncoder/Decoder.
- server and WSRP producer tests are failing due to mess with modules... >:-(

Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -113,7 +113,7 @@
       while (iterator.hasNext())
       {
          String name = (String)iterator.next();
-         name = FastURLEncoder.getInstance().encode(name);
+         name = FastURLEncoder.getUTF8Instance().encode(name);
          buffer.append('/').append(name);
       }
    }

Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -126,7 +126,7 @@
       for (Iterator i = id.getPath().names(); i.hasNext();)
       {
          String name = (String)i.next();
-         name = FastURLEncoder.getInstance().encode(name);
+         name = FastURLEncoder.getUTF8Instance().encode(name);
          buffer.append('/').append(name);
       }
    }

Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -123,13 +123,13 @@
       for (Iterator i = encoder.getQueryParameters().entrySet().iterator(); i.hasNext();)
       {
          Map.Entry entry = (Map.Entry)i.next();
-         String name = FastURLEncoder.getInstance().encode((String)entry.getKey());
+         String name = FastURLEncoder.getUTF8Instance().encode((String)entry.getKey());
          String[] values = (String[])entry.getValue();
          for (int j = 0; j < values.length; j++)
          {
             String value = values[j];
             url.append("&amp;").append(name).append('=');
-            FastURLEncoder.getInstance().encode(value, url);
+            FastURLEncoder.getUTF8Instance().encode(value, url);
          }
       }
 

Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -49,7 +49,7 @@
 {
 
    /** The fast url encoder. */
-   private static final FastURLEncoder urlEncoder = FastURLEncoder.getInstance();
+   private static final FastURLEncoder urlEncoder = FastURLEncoder.getUTF8Instance();
 
    /** The client request. */
    private final HttpServletRequest req;

Modified: branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -67,12 +67,13 @@
       url.append(requestContext.request.getContextPath());
       url.append(requestContext.request.getServletPath());
 
+      FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
       //
       if (object instanceof WindowObject)
       {
          WindowObject window = (WindowObject)object;
          url.append("/window/");
-         FastURLEncoder.getInstance().encode(window.getId(), url);
+         encoder.encode(window.getId(), url);
       }
       else
       {
@@ -86,9 +87,9 @@
          String key = (String)entry.getKey();
          String value = (String)entry.getValue();
          url.append(i.isFirst() ? '?' : '&');
-         FastURLEncoder.getInstance().encode(key, url);
+         encoder.encode(key, url);
          url.append('=');
-         FastURLEncoder.getInstance().encode(value, url);
+         encoder.encode(value, url);
       }
 
       return url.toString();

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -133,7 +133,8 @@
             String value = values != null ? values[0] : prefInfo.getDefaultValue();
             if (value != null)
             {
-               tmp.append("&amp;up_").append(FastURLEncoder.getInstance().encode(prefName)).append("=").append(FastURLEncoder.getInstance().encode(value));
+               FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
+               tmp.append("&amp;up_").append(encoder.encode(prefName)).append("=").append(encoder.encode(value));
             }
          }
 

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -84,7 +84,7 @@
          byte[] bytes;
          if ("http".equals(url.getProtocol()))
          {
-            bytes = URLTools.performGET(url, connectionTimeout, connectionTimeout);
+            bytes = URLTools.getContent(url, connectionTimeout, connectionTimeout);
          }
          else
          {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -361,7 +361,7 @@
 
    private byte[] obtainURL(URL url) throws Exception
    {
-      return URLTools.performGET(url, 5000, 5000);
+      return URLTools.getContent(url, 5000, 5000);
    }
 
 }

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java	2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java	2007-11-01 05:18:03 UTC (rev 8811)
@@ -25,7 +25,7 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.net.URLStreamOpeningThread;
+import org.jboss.portal.common.net.URLTools;
 import org.jboss.portal.common.util.ParameterValidation;
 import org.xml.sax.InputSource;
 
@@ -214,42 +214,13 @@
       {
          log.info("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
 
-         URLStreamOpeningThread thread = new URLStreamOpeningThread(wsdlURL);
-         thread.start();
-
-         // Wait for the thread to finish but don't wait longer than the specified time
-         long delayMillis = TIME_OUT_MS;
          try
          {
-            thread.join(delayMillis);
-
-            if (thread.isAlive())
-            {
-               // Timeout occurred; thread has not finished
-               // todo: do we need more clean up here?
-               IOTools.safeClose(thread.getInputStream());
-               throw new RuntimeException("Couldn't connect to " + wsdlURL + " within " + delayMillis / 1000
-                  + " seconds. Check your connection parameters or the URL.");
-            }
-            else
-            {
-               // Finished
-               if (thread.isConnected() && !thread.isError())
-               {
-                  InputStream is = IOTools.safeBufferedWrapper(thread.getInputStream());
-                  return new InputSource(is);
-               }
-               else
-               {
-                  throw new RuntimeException("An error occured while parsing the WSDL file at " + wsdlURL,
-                     thread.getException());
-               }
-            }
+            return new InputSource(URLTools.getContentAsInputStream(wsdlURL, TIME_OUT_MS, TIME_OUT_MS));
          }
-         catch (InterruptedException e)
+         catch (IOException e)
          {
-            // Thread was interrupted
-            throw new RuntimeException("Parsing thread was interrupted!", e);
+            throw new RuntimeException("Couldn't retrieve WSDL for " + wsdlURL, e);
          }
       }
 




More information about the portal-commits mailing list