[portal-commits] JBoss Portal SVN: r9067 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/test/widget/netvibes and 9 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Nov 21 12:32:47 EST 2007


Author: emuckenhuber
Date: 2007-11-21 12:32:46 -0500 (Wed, 21 Nov 2007)
New Revision: 9067

Removed:
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/directory/NetvibesWidgetApplicationType.java
Modified:
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/GGQueryTestCase.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesProviderTestCase.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryResultTestCase.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryTestCase.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetProvider.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetQuery.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesProvider.java
   branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
   branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
Log:
JBPORTAL-1534: only lookup uwa compatible widgets
and some minor changes

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/GGQueryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/GGQueryTestCase.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/GGQueryTestCase.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -55,6 +55,14 @@
       GGQuery q2 = new GGQuery(0, 10, "foo", "foo", new Locale("de", "at"));
       assertTrue(q1.equals(q2));
    }
+
    
+   public void test03()
+   {
+      GGQuery q1 = new GGQuery(0, "foo", "foo", new Locale("de", "at"));
+      GGQuery q2 = new GGQuery(0, 10, "foo", "foo", new Locale("de", "at"));
+      assertTrue(q1.equals(q2));
+   }
+   
 }
 

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -154,7 +154,7 @@
       }
       catch (WidgetNotSupportedException e)
       {
-         // ok urlparam not supported for now
+         // urlparam not supported - ok for now
       }
    }
    
@@ -170,7 +170,7 @@
       }
       catch (WidgetNotSupportedException e)
       {
-         // ok urlparam not supported for now
+         // urlparam not supported - ok for now
       }
    }
 

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesProviderTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesProviderTestCase.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesProviderTestCase.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -28,6 +28,8 @@
 import org.jboss.portal.test.widget.support.TestQuery;
 import org.jboss.portal.widget.DirectoryQueryResult;
 import org.jboss.portal.widget.WidgetProvider;
+import org.jboss.portal.widget.exceptions.DirectoryResultFailure;
+import org.jboss.portal.widget.exceptions.WidgetException;
 import org.jboss.portal.widget.netvibes.provider.NetvibesProvider;
 
 /**
@@ -73,6 +75,22 @@
             provider.stop();
             
             assertEquals(0, result.resultSize());
+            if ( result instanceof DirectoryResultFailure)
+            {
+               DirectoryResultFailure r = (DirectoryResultFailure) result;
+               if ( r.getCause() instanceof WidgetException)
+               {
+                  // ok
+               }
+               else
+               {
+                  fail("Exception must be of type WidgetException");
+               }
+            }
+            else
+            {
+               fail("Directory lookup must fail.");
+            }
          }
       };
       server.performInteraction();
@@ -92,6 +110,22 @@
             provider.stop();
             
             assertEquals(0, result.resultSize());
+            if ( result instanceof DirectoryResultFailure)
+            {
+               DirectoryResultFailure r = (DirectoryResultFailure) result;
+               if ( r.getCause() instanceof WidgetException)
+               {
+                  // ok
+               }
+               else
+               {
+                  fail("Exception must be of type WidgetException");
+               }
+            }
+            else
+            {
+               fail("Directory lookup must fail.");
+            }
          }
       };
       server.performInteraction();
@@ -112,6 +146,22 @@
             provider.stop();
             
             assertEquals(0, result.resultSize());
+            if ( result instanceof DirectoryResultFailure)
+            {
+               DirectoryResultFailure r = (DirectoryResultFailure) result;
+               if ( r.getCause() instanceof WidgetException)
+               {
+                  // ok
+               }
+               else
+               {
+                  fail("Exception must be of type WidgetException");
+               }
+            }
+            else
+            {
+               fail("Directory lookup must fail.");
+            }
          }
       };
       server.performInteraction();

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryResultTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryResultTestCase.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryResultTestCase.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -110,6 +110,8 @@
          NetvibesQueryResultBuilder builder = new NetvibesQueryResultBuilder(url);
          NetvibesQueryResult result = builder.build(5000);
          assertNotNull(result);
+         assertEquals(24, result.resultSize());
+         
       }
       catch(WidgetException e)
       {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryTestCase.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryTestCase.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -35,23 +35,30 @@
 
    public void test01() throws Exception
    {
-     NetvibesQuery q = new NetvibesQuery(0, 10, "14", "all", "foo");
-     assertEquals("http://eco.netvibes.com/rss.php?synd=jboss&count=10&cat=14&type=all&q=foo", q.buildQueryURL().toString());
+     NetvibesQuery q = new NetvibesQuery(0, 10, "14", "top", "foo");
+     assertEquals("http://eco.netvibes.com/rss.php?synd=jboss&type=uwa&count=10&cat=14&sort=top&q=foo", q.buildQueryURL().toString());
    }
 
    
    public void test02() throws Exception
    {
      NetvibesQuery q = new NetvibesQuery(1, 11, "5", "foo", "bar");
-     assertEquals("http://eco.netvibes.com/rss.php?synd=jboss&start=1&count=11&cat=5&type=foo&q=bar", q.buildQueryURL().toString());
+     assertEquals("http://eco.netvibes.com/rss.php?synd=jboss&type=uwa&start=1&count=11&cat=5&sort=foo&q=bar", q.buildQueryURL().toString());
    }
    
    public void test03()
    {
-      NetvibesQuery q1 = new NetvibesQuery(0, 10, "14", "all", "foo");
-      NetvibesQuery q2 = new NetvibesQuery(0, 10, "14", "all", "foo");
+      NetvibesQuery q1 = new NetvibesQuery(0, 10, "14", "latest", "foo");
+      NetvibesQuery q2 = new NetvibesQuery(0, 10, "14", "latest", "foo");
       assertTrue(q1.equals(q2));
    }
+
+   public void test04()
+   {
+      NetvibesQuery q1 = new NetvibesQuery(1, 10, "14", "top", "foo");
+      NetvibesQuery q2 = new NetvibesQuery(1, 10, "14", "latest", "foo");
+      assertFalse(q1.equals(q2));
+   }
    
 }
 

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -55,11 +55,11 @@
    /** The scheduled executor */
    protected ScheduledExecutorService scheduledExecutor;
 
-   /** The entry expiration time in millis (default: 1 day) */
-   protected long entryExpiration = TimeUnit.MILLISECONDS.convert(86400, TimeUnit.SECONDS);
+   /** The entry expiration time in millis (default: 6 hours) */
+   protected long entryExpiration = TimeUnit.MILLISECONDS.convert(21600, TimeUnit.SECONDS);
 
-   /** The query expiration time in millis (default: 15 minutes) */
-   protected long queryExpiration = TimeUnit.MILLISECONDS.convert(900, TimeUnit.SECONDS);
+   /** The query expiration time in millis (default: 1 hour) */
+   protected long queryExpiration = TimeUnit.MILLISECONDS.convert(3600, TimeUnit.SECONDS);
 
    /** Fetch all widgets in on the directory lookup */
    private boolean fetchWidgetsOnDirectoryLookup = false;

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetProvider.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetProvider.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -35,10 +35,12 @@
    public void start();
    
    public void stop();
+   
 
    public Widget getWidget(URL url) throws InterruptedException, ExecutionException;
    
    public DirectoryQueryResult search(WidgetQuery query);
+   
 
    public void setConnectionTimeout(int connectionTimeout);
  

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetQuery.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetQuery.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetQuery.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -31,11 +31,9 @@
  */
 public interface WidgetQuery
 {
-  
-   /** . */
+
    public boolean equals(Object foo);
    
-   /** . */
    public URL buildQueryURL() throws MalformedURLException;
    
 }

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetPortlet.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -133,6 +133,12 @@
       Widget widget = provider.getWidget(uri);
       if (widget != null)
       {
+         /** breaks the portlet-titlebar if too long
+         if (widget.getTitle() != null)
+         {
+            resp.setTitle(widget.getTitle().getDefaultString() + " (Google Widget)");
+         }
+         */
          writer.print(widget.render(req.getParameterMap(), req.getLocale()));
       }
       else

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -49,7 +49,7 @@
    private final String id; 
    
    /** The default widget height */
-   private final static String defaultHeight = "215"; 
+   private final static String defaultHeight = "250"; 
    
    /** The netvibes widget info */
    private final NetvibesWidgetInfo widgetInfo;
@@ -123,7 +123,7 @@
             }
          }
 
-         String actualHeight = tempHeight != null ? String.valueOf(Integer.valueOf(tempHeight).intValue() + 15) : defaultHeight;
+         String actualHeight = tempHeight != null ? String.valueOf(Integer.valueOf(tempHeight).intValue() + 50) : defaultHeight;
          
          StringBuffer output = new StringBuffer();
          output.append("<iframe id=\"frame_"+ id +"\" frameborder=\"0\" width=\"100%\" height=\""+ actualHeight +"\" ");

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidgetPortlet.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -91,10 +91,10 @@
                params.put("cat", new String[]{catParam});
             }
             
-            String typeParam = req.getParameter("type");
-            if (catParam != null)
+            String sortParam = req.getParameter("sort");
+            if (sortParam != null)
             {
-               params.put("type", new String[]{typeParam});
+               params.put("sort", new String[]{sortParam});
             }
 
             String currentPage = req.getParameter("currentPage");
@@ -137,6 +137,12 @@
       Widget widget = provider.getWidget(uri);
       if (widget != null)
       {
+         /** breaks the portlet-titlebar if too long
+         if( widget.getTitle() != null)
+         {
+            resp.setTitle(widget.getTitle().getDefaultString() + " (Netvibes Widget)");
+         }
+         */
          writer.print(widget.render(req.getParameterMap(), req.getLocale()));
       }
       else

Deleted: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/directory/NetvibesWidgetApplicationType.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/directory/NetvibesWidgetApplicationType.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/directory/NetvibesWidgetApplicationType.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -1,54 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
- * contributors as indicated by the @authors tag. See the                     *
- * copyright.txt in the distribution for a full listing of                    *
- * individual contributors.                                                   *
- *                                                                            *
- * This is free software; you can redistribute it and/or modify it            *
- * under the terms of the GNU Lesser General Public License as                *
- * published by the Free Software Foundation; either version 2.1 of           *
- * the License, or (at your option) any later version.                        *
- *                                                                            *
- * This software is distributed in the hope that it will be useful,           *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
- * Lesser General Public License for more details.                            *
- *                                                                            *
- * You should have received a copy of the GNU Lesser General Public           *
- * License along with this software; if not, write to the Free                *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
- ******************************************************************************/
-package org.jboss.portal.widget.netvibes.directory;
-
-/**
- * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class NetvibesWidgetApplicationType
-{
-
-   private String id;
-   
-   private String description;
-   
-   public NetvibesWidgetApplicationType(String id, String description)
-   {
-      this.id = id;
-      this.description = description;
-   }
-
-   public String getId()
-   {
-      return id;
-   }
-
-   public String getDescription()
-   {
-      return description;
-   }
-   
-   
-}
-

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesProvider.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesProvider.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -33,7 +33,6 @@
 import org.jboss.portal.widget.ExpiringFutureTask;
 import org.jboss.portal.widget.Widget;
 import org.jboss.portal.widget.WidgetQuery;
-import org.jboss.portal.widget.netvibes.directory.NetvibesWidgetApplicationType;
 import org.jboss.portal.widget.netvibes.directory.NetvibesWidgetCategory;
 
 /**
@@ -61,25 +60,11 @@
          .add(new NetvibesWidgetCategory("15", "Sciences"))
          .get());
 
-   /** The netvibes application types */
-   private static final Collection TYPES = Collections.unmodifiableList((List)CollectionBuilder.arrayList()
-         .add(new NetvibesWidgetApplicationType("all", "All"))
-         .add(new NetvibesWidgetApplicationType("application", "Application"))
-         .add(new NetvibesWidgetApplicationType("feed", "Feed"))
-         .add(new NetvibesWidgetApplicationType("podcast", "Podcast"))
-         .add(new NetvibesWidgetApplicationType("event", "Event"))
-         .get());
-
    public Collection getCategories()
    {
       return CATEGORIES;
    }
    
-   public Collection getApplicationTypes()
-   {
-      return TYPES;
-   }
-   
    @Override
    protected void addDirectoryResult(WidgetQuery query)
    {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQuery.java	2007-11-21 17:32:46 UTC (rev 9067)
@@ -39,27 +39,30 @@
    private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(NetvibesQuery.class);
    
    /** . */
-   private int start;
+   private final int start;
 
    /** Zero or negative means it is not used. */
    private int count = 10;
 
    /** . */
-   private String cat;
+   private final String cat;
    
    /** . */
-   private String type;
+   private final String type = "uwa";
+   
+   /** .*/
+   private final String sort;
 
    /** . */
-   private String q;
+   private final String q;
    
    /** . */
-   private Locale locale;
+//   private Locale locale;
 
    /** . */
    private int hashCode;
    
-   public NetvibesQuery(int start, int num, String cat, String type, String q)
+   public NetvibesQuery(int start, int num, String cat, String sort, String q)
    {
       if (start < 0)
       {
@@ -78,9 +81,9 @@
       this.start = start;
       this.count = num;
       this.cat = cat;
+      this.sort = sort;
       this.q = q;
-      this.type = type;
-      this.hashCode = start + num + (cat == null ? 0 : 1 + cat.hashCode()) + (q == null ? 0 : 1 + q.hashCode()) + (type == null ? 0 : 1 + type.hashCode());
+      this.hashCode = start + num + (cat == null ? 0 : 1 + cat.hashCode()) + (q == null ? 0 : 1 + q.hashCode()) + (sort == null ? 0 : 1 + sort.hashCode());
    }
    
    public int getStart()
@@ -116,7 +119,8 @@
          (this.start == that.start) &&
          (this.count == that.count) &&
             (this.cat == null ? that.cat == null : this.cat.equals(that.cat)) &&
-            (this.q == null ? that.q == null : this.q.equals(that.q));
+            (this.q == null ? that.q == null : this.q.equals(that.q)) &&
+            (this.sort == null ? that.sort == null : this.sort.equals(that.sort));
       }
       return false;
    }
@@ -128,7 +132,8 @@
    
    public URL buildQueryURL() throws MalformedURLException
    {
-      StringBuffer buffer = new StringBuffer("http://eco.netvibes.com/rss.php?synd=jboss");
+      // Building url - and only allow UWA compatible widgets (type=uwa)
+      StringBuffer buffer = new StringBuffer("http://eco.netvibes.com/rss.php?synd=jboss&type=" + type);
       if( start > 0 )
       {
          buffer.append("&start=").append(start);
@@ -141,9 +146,9 @@
       {
          buffer.append("&cat=").append(cat);
       }
-      if (type != null)
+      if(sort != null)
       {
-         buffer.append("&type=").append(type);
+         buffer.append("&sort=").append(sort);
       }
       if (q != null)
       {

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp	2007-11-21 17:32:46 UTC (rev 9067)
@@ -1,5 +1,4 @@
 <%@page import="org.jboss.portal.widget.netvibes.directory.NetvibesWidgetCategory"%>
-<%@page import="org.jboss.portal.widget.netvibes.directory.NetvibesWidgetApplicationType"%>
 <%@page import="org.jboss.portal.widget.netvibes.provider.NetvibesProvider"%>
 <%@page import="org.jboss.portal.widget.netvibes.NetvibesPreferenceInfo"%>
 <%@page import="org.jboss.portal.widget.netvibes.provider.NetvibesQuery"%>
@@ -58,10 +57,10 @@
 	}
 	
 	// Type
-	String type = request.getParameter("type");
-	if (type == null)
+	String sort = request.getParameter("sort");
+	if (sort == null)
 	{
-		type = "all";
+		sort = "top";
 	}
 
 	// Get category term
@@ -73,7 +72,7 @@
 
 	// Compute query
 	int queryStart = currentPage * numberOfResults;
-	NetvibesQuery query = new NetvibesQuery(queryStart, numberOfResults + 1, catTerm, type, queryTerm);
+	NetvibesQuery query = new NetvibesQuery(queryStart, numberOfResults + 1, catTerm, sort, queryTerm);
 	DirectoryQueryResult queryResults = provider.search(query);
 	   
 	boolean uriPickMethod = false;
@@ -144,20 +143,6 @@
          				 }
          %>
       </select>&nbsp;
-      <select name="type" class="portlet-form-field">
-         <%
-         		// Category dropdown
-                         for (Iterator i = provider.getApplicationTypes().iterator(); i.hasNext();)
-                         {
-                            NetvibesWidgetApplicationType appType = (NetvibesWidgetApplicationType)i.next();
-                            boolean selected = appType.getId().equals(type);
-         %>
-         <option value="<%= appType.getId() %>" <%= selected ? "selected=\"selected\"" : "" %>><%=appType.getDescription()%>
-         </option>
-         <%
-         				 }
-         %>
-      </select>&nbsp;
       <select name="numberOfResults" class="portlet-form-field">
       	<%
       			// Number of results dropdown
@@ -234,7 +219,7 @@
                // Propagage search nav state
                selectURL.setParameter("cat", catTerm);
                selectURL.setParameter("query", queryTerm);
-               selectURL.setParameter("type", type);
+               selectURL.setParameter("sort", sort);
                selectURL.setParameter("currentPage", String.valueOf(currentPage));
                selectURL.setParameter("numberOfResults", String.valueOf(numberOfResults));
 
@@ -262,7 +247,7 @@
    				PortletURL prevURL = renderResponse.createRenderURL();
    				prevURL.setParameter("cat", catTerm);
    				prevURL.setParameter("query", queryTerm);
-   				prevURL.setParameter("type", type);
+   				prevURL.setParameter("sort", sort);
    				prevURL.setParameter("numberOfResults", String.valueOf(numberOfResults));
    	   			
    	        	String prevPage = String.valueOf(currentPage - 1);
@@ -279,7 +264,7 @@
 	   			PortletURL nextURL = renderResponse.createRenderURL();
 	   			nextURL.setParameter("cat", catTerm);
 	   			nextURL.setParameter("query", queryTerm);
-	   			nextURL.setParameter("type", type);
+	   			nextURL.setParameter("sort", sort);
 	   			nextURL.setParameter("numberOfResults", String.valueOf(numberOfResults));
 	        	
 	        	String nextPage = String.valueOf(currentPage + 1);
@@ -381,11 +366,11 @@
 				      		break;
 				   // PASSWORD
 				   case NVDataType.PASSWORD: %><input type="password" name="content.param.<%= prefInfo.getName() %>" class="portlet-form-field" 
-					 	value="<%= prefValue != null ? prefValue : "" %>" maxlength="255"/><%
+					 	value="<%= prefValue != null ? prefValue.replace("\"", "'") : "" %>" maxlength="255"/><%
 				      		break;
 				    // DEFAULT TEXT
 				   	default: %><input type="text" name="content.param.<%= prefInfo.getName() %>" class="portlet-form-field" 
-							 	value="<%= prefValue != null ? prefValue : "" %>" maxlength="255"/><%
+							 	value="<%= prefValue != null ? prefValue.replace("\"", "'") : "" %>" /><%
 							break;
 				}
 		%></td>

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml	2007-11-21 17:32:46 UTC (rev 9067)
@@ -38,14 +38,14 @@
          <value>5000</value>
       </init-param>
       <init-param>
-         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 1 day.</description>
+         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 6 hours.</description>
          <name>entryExpiration</name>
-         <value>1440</value>
+         <value>360</value>
       </init-param>
       <init-param>
-         <description>Time until a query expires. Default value is 15 minutes.</description>
+         <description>Time until a query expires (in minutes). Default value is 1 hour.</description>
          <name>queryExpiration</name>
-         <value>15</value>
+         <value>60</value>
       </init-param>
       <supports>
          <mime-type>text/html</mime-type>

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp	2007-11-21 17:32:46 UTC (rev 9067)
@@ -376,7 +376,7 @@
                default:
             %>
             <td><input type="text" name="content.param.<%= prefInfo.getName() %>" class="portlet-form-field"
-                       value="<%= prefValue %>"/></td>
+                       value="<%= prefValue.replace("\"", "'") %>"/></td>
             <%
                      break;
                } // endof switch

Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml	2007-11-21 16:02:30 UTC (rev 9066)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml	2007-11-21 17:32:46 UTC (rev 9067)
@@ -38,14 +38,14 @@
          <value>5000</value>
       </init-param>
       <init-param>
-         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 1 day.</description>
+         <description>Time until a Widget expires and gets refreshed (in minutes). Default value is 6 hours.</description>
          <name>entryExpiration</name>
-         <value>1440</value>
+         <value>360</value>
       </init-param>
       <init-param>
-         <description>Time until a query expires. Default value is 15 minutes.</description>
+         <description>Time until a query expires. Default value is 1 hour.</description>
          <name>queryExpiration</name>
-         <value>15</value>
+         <value>60</value>
       </init-param>
       <supports>
          <mime-type>text/html</mime-type>




More information about the portal-commits mailing list