JBoss Portal SVN: r9038 - in branches/JBoss_Portal_Branch_2_6: core and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 10:59:15 -0500 (Tue, 20 Nov 2007)
New Revision: 9038
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/JBoss_Portal_Branch_2_6/core/build.xml
Log:
allow 2.6 core to be build with a subset of modules
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-20 15:34:48 UTC (rev 9037)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-11-20 15:59:15 UTC (rev 9038)
@@ -153,6 +153,10 @@
<include groups="portal"/>
</group>
+ <group name="core">
+ <include modules="api, jems, server, security, portlet-server, theme, registration, format, core"/>
+ </group>
+
</moduleconfig>
<!-- Configure project defaults -->
Modified: branches/JBoss_Portal_Branch_2_6/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-11-20 15:34:48 UTC (rev 9037)
+++ branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-11-20 15:59:15 UTC (rev 9038)
@@ -334,8 +334,6 @@
<fileset dir="${jboss.portal-api.root}/lib" includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-theme.root}/lib" includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
- <fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
- <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}" includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
@@ -348,6 +346,11 @@
<fileset dir="${jbpm.jaronly.lib}" includes="jbpm.jar,jbpm-identity.jar"/>
</copy>
+ <copy todir="${build.resources}/jboss-portal/lib" failonerror="false">
+ <fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
+ <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar"/>
+ </copy>
+
<!--dtd-->
<copy todir="${build.resources}/jboss-portal/dtd">
<fileset dir="${jboss.portal/modules/identity.root}/resources/dtd" includes="*.dtd"/>
16 years, 7 months
JBoss Portal SVN: r9037 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-20 10:34:48 -0500 (Tue, 20 Nov 2007)
New Revision: 9037
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java
Log:
- Revert constants to public as they are used by WSRP.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java 2007-11-20 14:00:22 UTC (rev 9036)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/p3p/P3PConstants.java 2007-11-20 15:34:48 UTC (rev 9037)
@@ -31,28 +31,28 @@
{
// Postal
- private static final String POSTAL_NAME = "postal.name";
- private static final String POSTAL_STREET = "postal.street";
- private static final String POSTAL_CITY = "postal.city";
- private static final String POSTAL_STATEPROV = "postal.stateprov";
- private static final String POSTAL_POSTALCODE = "postal.postalcode";
- private static final String POSTAL_COUNTRY = "postal.country";
- private static final String POSTAL_ORGANIZATION = "postal.organization";
+ public static final String POSTAL_NAME = "postal.name";
+ public static final String POSTAL_STREET = "postal.street";
+ public static final String POSTAL_CITY = "postal.city";
+ public static final String POSTAL_STATEPROV = "postal.stateprov";
+ public static final String POSTAL_POSTALCODE = "postal.postalcode";
+ public static final String POSTAL_COUNTRY = "postal.country";
+ public static final String POSTAL_ORGANIZATION = "postal.organization";
// Telecom
- private static final String TELECOM_TELEPHONE = "telecom.telephone.";
- private static final String TELECOM_FAX = "telecom.fax.";
- private static final String TELECOM_MOBILE = "telecom.mobile.";
- private static final String TELECOM_PAGER = "telecom.pager.";
- private static final String INTCODE = "intcode";
- private static final String LOCCODE = "loccode";
- private static final String NUMBER = "number";
- private static final String EXT = "ext";
- private static final String COMMENT = "comment";
+ public static final String TELECOM_TELEPHONE = "telecom.telephone.";
+ public static final String TELECOM_FAX = "telecom.fax.";
+ public static final String TELECOM_MOBILE = "telecom.mobile.";
+ public static final String TELECOM_PAGER = "telecom.pager.";
+ public static final String INTCODE = "intcode";
+ public static final String LOCCODE = "loccode";
+ public static final String NUMBER = "number";
+ public static final String EXT = "ext";
+ public static final String COMMENT = "comment";
// Online
- private static final String ONLINE_URI = "online.uri";
- private static final String ONLINE_EMAIL = "online.email";
+ public static final String ONLINE_URI = "online.uri";
+ public static final String ONLINE_EMAIL = "online.email";
/*
* User information attribute names (PLT.D in the portlet spec) that are defined in P3P spec.
16 years, 7 months
JBoss Portal SVN: r9036 - branches.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-20 09:00:22 -0500 (Tue, 20 Nov 2007)
New Revision: 9036
Added:
branches/presentation/
Log:
create presentation branch
16 years, 7 months
JBoss Portal SVN: r9035 - in branches/JBoss_Portal_Branch_2_6/widget/src: main/org/jboss/portal/widget and 2 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-20 08:57:10 -0500 (Tue, 20 Nov 2007)
New Revision: 9035
Added:
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/widget/exceptions/
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetException.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFetchException.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetMetaDataParseException.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetNotSupportedException.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response_fail
branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_1_fail.xml
branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2.xml
branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2_fail.xml
Log:
missing stuff
Added: 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 (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/GGQueryTestCase.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.test.widget.google;
+
+import java.net.MalformedURLException;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+import org.jboss.portal.widget.google.provider.GGQuery;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class GGQueryTestCase extends TestCase
+{
+
+ public void test01()
+ {
+ try
+ {
+ GGQuery q = new GGQuery(0, 10, "foo", "foo", new Locale("de", "at"));
+ assertEquals("http://www.google.com/ig/directory?synd=jboss&output=rss&num=10&cat=foo&q...", q.buildQueryURL().toString());
+ }
+ catch(MalformedURLException e)
+ {
+ fail("MalformedURLException");
+ }
+ }
+
+ public void test02()
+ {
+ GGQuery q1 = new GGQuery(0, 10, "foo", "foo", new Locale("de", "at"));
+ GGQuery q2 = new GGQuery(0, 10, "foo", "foo", new Locale("de", "at"));
+ assertTrue(q1.equals(q2));
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/DirectoryResultFailure.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.exceptions;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import org.jboss.portal.widget.DirectoryQueryResult;
+import org.jboss.portal.widget.DirectoryQueryResultEntry;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class DirectoryResultFailure implements DirectoryQueryResult
+{
+
+ /** . */
+ private final Exception e;
+
+ public DirectoryResultFailure(Exception e)
+ {
+ this.e = e;
+ }
+
+ public String getMessage()
+ {
+ return e.getMessage();
+ }
+
+ public Throwable getCause()
+ {
+ return e.getCause();
+ }
+
+ public List<URL> collection()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ public Iterator<? extends DirectoryQueryResultEntry> entries()
+ {
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ public int resultSize()
+ {
+ return 0;
+ }
+
+ public String getLocalizedErrorMessage(Locale locale)
+ {
+ return "Directory lookup failed";
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetException.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetException.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetException.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.exceptions;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class WidgetException extends Exception
+{
+
+ public WidgetException(String message)
+ {
+ super(message);
+ }
+
+ public WidgetException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WidgetException(Throwable cause)
+ {
+ super(cause);
+ }
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.exceptions;
+
+import java.net.URL;
+import java.util.Locale;
+import java.util.Map;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.widget.Widget;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class WidgetFailure implements Widget
+{
+
+ /** . */
+ private final URL url;
+
+ /** . */
+ private final Exception e;
+
+ public WidgetFailure(URL url, Exception e)
+ {
+ this.url = url;
+ this.e = e;
+ }
+
+ public String getMessage()
+ {
+ return e.getMessage();
+ }
+
+ public Throwable getCause()
+ {
+ return e.getCause();
+ }
+
+ public String getId()
+ {
+ return url.toString();
+ }
+
+ public String render(Map parameters)
+ {
+ return render(parameters, null);
+ }
+
+ public String render(Map parameters, Locale locale)
+ {
+ return getLocalizedErrorMessage(locale);
+ }
+
+ public String getLocalizedErrorMessage(Locale locale)
+ {
+ String urlString = url != null ? url.toString() : null;
+ Throwable cause = e.getCause();
+ if ( cause instanceof WidgetException )
+ {
+ if (cause instanceof WidgetNotSupportedException)
+ {
+ return "This widget type is not supported: "+ urlString;
+ }
+ else
+ if (cause instanceof WidgetFetchException)
+ {
+ return "Failed to fetch Widget: " + urlString;
+ }
+ else
+ {
+ return "Error while retreiving Widget: "+ urlString;
+ }
+ }
+ else
+ {
+ return "Error getting widget: "+ urlString;
+ }
+ }
+
+ public LocalizedString getDescription()
+ {
+ // FIXME getDescription
+ return null;
+ }
+
+ public LocalizedString getTitle()
+ {
+ // FIXME getTitle
+ return null;
+ }
+}
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFetchException.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFetchException.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFetchException.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.exceptions;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class WidgetFetchException extends WidgetException
+{
+
+ public WidgetFetchException(String message)
+ {
+ super(message);
+ }
+
+ public WidgetFetchException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WidgetFetchException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetMetaDataParseException.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetMetaDataParseException.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetMetaDataParseException.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.exceptions;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class WidgetMetaDataParseException extends WidgetException
+{
+
+ public WidgetMetaDataParseException(String message)
+ {
+ super(message);
+ }
+
+ public WidgetMetaDataParseException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WidgetMetaDataParseException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetNotSupportedException.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetNotSupportedException.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/exceptions/WidgetNotSupportedException.java 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.exceptions;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class WidgetNotSupportedException extends WidgetException
+{
+
+ public WidgetNotSupportedException(String message)
+ {
+ super(message);
+ }
+
+ public WidgetNotSupportedException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WidgetNotSupportedException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response_fail
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response_fail (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response_fail 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,4 @@
+{"title":"What time is it ?",
+"icon":{"0":"http:\/\/nvmodules.typhon.net\/ben\/time.ico"},
+"metas":{},
+"preferences":[]}
Added: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_1_fail.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_1_fail.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_1_fail.xml 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
+ <channel>
+ <title><![CDATA[Netvibes ecosystem latest modules]]></title>
+ <link>http://eco.netvibes.com</link>
+ <description><![CDATA[Netvibes ecosystem latest modules]]></description>
+ <pubDate>Fri, 16 Nov 2007 12:44:27 +0000</pubDate>
+ <generator>Netvibes Ecosystem</generator>
+
+ <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+ <!--
+ <item>
+ -->
+ <title><![CDATA[The Jerusalem Post]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=...</link>
+ <guid>http://eco.netvibes.com/6/206552</guid>
+ <description><![CDATA[Latest news from The Jerusalem Post, the world's top English-language daily newspaper covering Israel, the Middle East and the Jewish World.]]></description>
+ <pubDate>Thu, 15 Nov 2007 08:57:46 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206552" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[WMLScript reference]]></title>
+ <link>http://freebestoffer.com/downloads/wmlscript.html</link>
+ <guid>http://eco.netvibes.com/6/206470</guid>
+ <description><![CDATA[Search through WMLScript help, reference, tutorials and examples.]]></description>
+
+ <pubDate>Tue, 13 Nov 2007 16:13:34 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206470" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Web developer's help]]></title>
+ <link>http://freebestoffer.com/downloads/webdevel.html</link>
+ <guid>http://eco.netvibes.com/6/206469</guid>
+
+ <description><![CDATA[Search and browse help, tutorials, examples and reference documents on XML, XSLT, HTML, JavaScript, VBScript, Flash, SQL and more.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:36 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206469" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[VBScript reference]]></title>
+ <link>http://freebestoffer.com/downloads/vbscript.html</link>
+
+ <guid>http://eco.netvibes.com/6/206468</guid>
+ <description><![CDATA[Search through Visual Basic script help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:39 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206468" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[SVG reference]]></title>
+
+ <link>http://freebestoffer.com/downloads/svg.html</link>
+ <guid>http://eco.netvibes.com/6/206467</guid>
+ <description><![CDATA[Search through SVG help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:42 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206467" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[SQL reference]]></title>
+ <link>http://freebestoffer.com/downloads/sql.html</link>
+ <guid>http://eco.netvibes.com/6/206466</guid>
+ <description><![CDATA[Search through SQL help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:44 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206466" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[SMIL reference]]></title>
+ <link>http://freebestoffer.com/downloads/smil.html</link>
+ <guid>http://eco.netvibes.com/6/206465</guid>
+ <description><![CDATA[Search through SMIL help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:47 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206465" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[PHP reference]]></title>
+ <link>http://freebestoffer.com/downloads/php.html</link>
+ <guid>http://eco.netvibes.com/6/206464</guid>
+ <description><![CDATA[Search through PHP help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:51 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206464" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Javascript Reference]]></title>
+ <link>http://freebestoffer.com/downloads/javascript.html</link>
+ <guid>http://eco.netvibes.com/6/206463</guid>
+ <description><![CDATA[Search and browse Javascript Reference.]]></description>
+
+ <pubDate>Tue, 13 Nov 2007 16:13:54 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206463" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[HTML DOM Reference]]></title>
+ <link>http://freebestoffer.com/downloads/htmldom.html</link>
+ <guid>http://eco.netvibes.com/6/206459</guid>
+
+ <description><![CDATA[Search and browse HTML DOM Reference.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:59 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206459" type="image/jpeg" length=""/>
+ </item>
+ </channel>
+</rss>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2.xml 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
+ <channel>
+ <title><![CDATA[Netvibes ecosystem latest all]]></title>
+ <link>http://eco.netvibes.com</link>
+ <description><![CDATA[Netvibes ecosystem latest all]]></description>
+ <pubDate>Tue, 20 Nov 2007 08:46:15 +0000</pubDate>
+ <generator>Netvibes Ecosystem</generator>
+
+ <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+ <item>
+ <title><![CDATA[Zeus`s Blog]]></title>
+ <link>http://eco.netvibes.com/2/206706</link>
+ <guid>http://eco.netvibes.com/2/206706</guid>
+ <description><![CDATA[A security news blog including the range of subjects networking, virtualization, hardware and software..]]></description>
+ <pubDate>Tue, 20 Nov 2007 03:07:19 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206706" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Off Topic ]]></title>
+ <link>http://eco.netvibes.com/2/206689</link>
+ <guid>http://eco.netvibes.com/2/206689</guid>
+ <description><![CDATA[Forum Off Topic di WinTricks RSS feed
+Politica arte cultura di tutto un po']]></description>
+
+ <pubDate>Mon, 19 Nov 2007 17:51:21 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206689" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Developpeur Web]]></title>
+ <link>http://eco.netvibes.com/4/206673</link>
+ <guid>http://eco.netvibes.com/4/206673</guid>
+
+ <description><![CDATA[Blog professionnel d'un développeur et concepteur d'applications web. Codes, librairies, idées et opinions.
+Auteur de Webappkit, QuizzGeek]]></description>
+ <pubDate>Mon, 19 Nov 2007 14:46:45 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206673" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[maestroalberto]]></title>
+ <link>http://eco.netvibes.com/2/206644</link>
+
+ <guid>http://eco.netvibes.com/2/206644</guid>
+ <description><![CDATA[Blog con novità e informazioni sulla vita digitale...]]></description>
+ <pubDate>Sun, 18 Nov 2007 15:38:36 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206644" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Túniti Noticias]]></title>
+
+ <link>http://eco.netvibes.com/2/206643</link>
+ <guid>http://eco.netvibes.com/2/206643</guid>
+ <description><![CDATA[Si quieres saber lo que pasa AHORA tuniti noticias es lo que buscas.
+
+Todo noticias actuales. Coge todas las noticias que se envian a meneame, fresqui, google news, yahoo, marca, vanguardia, el pais, as, 20 minutos, el periodico... y las publica en un clon de meneame y siempre en Portada.
+ ]]></description>
+ <pubDate>Sun, 18 Nov 2007 15:34:00 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206643" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[feed rss forum WinTricks]]></title>
+ <link>http://eco.netvibes.com/2/206636</link>
+ <guid>http://eco.netvibes.com/2/206636</guid>
+ <description><![CDATA[Forum Community WinTricks , le risposte che cerchi su Windows Software attualità , off topi]]></description>
+ <pubDate>Sun, 18 Nov 2007 12:27:46 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206636" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[Rss News Web WinTricks]]></title>
+ <link>http://eco.netvibes.com/2/206635</link>
+ <guid>http://eco.netvibes.com/2/206635</guid>
+ <description><![CDATA[Tutte le news curiosità dal web]]></description>
+ <pubDate>Sun, 18 Nov 2007 12:02:29 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206635" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[Martin Revert: "tecnólogo y todólogo"]]></title>
+ <link>http://eco.netvibes.com/2/206537</link>
+ <guid>http://eco.netvibes.com/2/206537</guid>
+ <description><![CDATA[Sociedad, Tecnología y todo lo que se cruce al medio de ambas cosas.]]></description>
+ <pubDate>Wed, 14 Nov 2007 22:49:18 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206537" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[El Blog al iPod]]></title>
+ <link>http://eco.netvibes.com/2/206511</link>
+ <guid>http://eco.netvibes.com/2/206511</guid>
+ <description><![CDATA[Este blog contiene las utlimas curiosidades y tendencias sobre el iPod]]></description>
+
+ <pubDate>Wed, 14 Nov 2007 16:35:43 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206511" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[NewzNozzl.com]]></title>
+ <link>http://eco.netvibes.com/2/206510</link>
+ <guid>http://eco.netvibes.com/2/206510</guid>
+
+ <description><![CDATA[NewzNozzl takes the top stories from the best social news sites, combines them - and then lets you comment and Vote for the stories that you think are the best. We ONLY load the high-rated stories from each site, so by the time it hits NewzNozzl, you know it's worth looking at! Most of the social news sites are often thought of as "meta" sites - that is, they take in and amplify what other news sites have. Nozzl can be thought of a "Meta-Meta" site - we take what other meta news sites thing are worth while and amplify just those stories.]]></description>
+ <pubDate>Wed, 14 Nov 2007 16:23:25 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206510" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[WMLScript reference]]></title>
+ <link>http://freebestoffer.com/downloads/wmlscript.html</link>
+
+ <guid>http://eco.netvibes.com/6/206470</guid>
+ <description><![CDATA[Search through WMLScript help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:34 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206470" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Web developer's help]]></title>
+
+ <link>http://freebestoffer.com/downloads/webdevel.html</link>
+ <guid>http://eco.netvibes.com/6/206469</guid>
+ <description><![CDATA[Search and browse help, tutorials, examples and reference documents on XML, XSLT, HTML, JavaScript, VBScript, Flash, SQL and more.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:36 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206469" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[VBScript reference]]></title>
+ <link>http://freebestoffer.com/downloads/vbscript.html</link>
+ <guid>http://eco.netvibes.com/6/206468</guid>
+ <description><![CDATA[Search through Visual Basic script help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:39 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206468" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[SVG reference]]></title>
+ <link>http://freebestoffer.com/downloads/svg.html</link>
+ <guid>http://eco.netvibes.com/6/206467</guid>
+ <description><![CDATA[Search through SVG help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:42 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206467" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[SQL reference]]></title>
+ <link>http://freebestoffer.com/downloads/sql.html</link>
+ <guid>http://eco.netvibes.com/6/206466</guid>
+ <description><![CDATA[Search through SQL help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:44 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206466" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[SMIL reference]]></title>
+ <link>http://freebestoffer.com/downloads/smil.html</link>
+ <guid>http://eco.netvibes.com/6/206465</guid>
+ <description><![CDATA[Search through SMIL help, reference, tutorials and examples.]]></description>
+
+ <pubDate>Tue, 13 Nov 2007 16:13:47 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206465" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[PHP reference]]></title>
+ <link>http://freebestoffer.com/downloads/php.html</link>
+ <guid>http://eco.netvibes.com/6/206464</guid>
+
+ <description><![CDATA[Search through PHP help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:51 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206464" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Javascript Reference]]></title>
+ <link>http://freebestoffer.com/downloads/javascript.html</link>
+
+ <guid>http://eco.netvibes.com/6/206463</guid>
+ <description><![CDATA[Search and browse Javascript Reference.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:54 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206463" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[HTML DOM Reference]]></title>
+
+ <link>http://freebestoffer.com/downloads/htmldom.html</link>
+ <guid>http://eco.netvibes.com/6/206459</guid>
+ <description><![CDATA[Search and browse HTML DOM Reference.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:13:59 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206459" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[E4X reference]]></title>
+ <link>http://freebestoffer.com/downloads/e4x.html</link>
+ <guid>http://eco.netvibes.com/6/206456</guid>
+ <description><![CDATA[Search through E4X help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:14:07 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206456" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[.Net Mobile reference]]></title>
+ <link>http://freebestoffer.com/downloads/dotnetmobile.html</link>
+ <guid>http://eco.netvibes.com/6/206454</guid>
+ <description><![CDATA[Search through .Net Mobile help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:14:10 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206454" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[Search DHTML help]]></title>
+ <link>http://freebestoffer.com/downloads/dhtml.html</link>
+ <guid>http://eco.netvibes.com/6/206452</guid>
+ <description><![CDATA[Search and browse DHTML help, reference and tutorials.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:14:15 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206452" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[ASP.Net reference]]></title>
+ <link>http://freebestoffer.com/downloads/aspdotnet.html</link>
+ <guid>http://eco.netvibes.com/6/206451</guid>
+ <description><![CDATA[Search through ASP.Net help, reference, tutorials and examples.]]></description>
+
+ <pubDate>Tue, 13 Nov 2007 16:14:21 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206451" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[ASP reference]]></title>
+ <link>http://freebestoffer.com/downloads/asp.html</link>
+ <guid>http://eco.netvibes.com/6/206450</guid>
+
+ <description><![CDATA[Search through ASP help, reference, tutorials and examples.]]></description>
+ <pubDate>Tue, 13 Nov 2007 16:14:29 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206450" type="image/jpeg" length=""/>
+ </item>
+ </channel>
+</rss>
Added: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2_fail.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2_fail.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/queryresult_2_fail.xml 2007-11-20 13:57:10 UTC (rev 9035)
@@ -0,0 +1,256 @@
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=cane in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=thebigbangtheory in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=howimetyourmother in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=showbuzz in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=csi in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=csiny in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference category=csimiami in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+<br />
+<b>Warning</b>: DOMDocument::createElement() [<a href='function.DOMDocument-createElement'>function.DOMDocument-createElement</a>]: unterminated entity reference title=RATP%20info%20trafic&height=300 in <b>/home/netvibes/eco.v3/lib/Zend/Feed/Rss.php</b> on line <b>383</b><br />
+
+<?xml version="1.0" encoding="utf-8"?>
+<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
+ <channel>
+ <title><![CDATA[Netvibes ecosystem latest all]]></title>
+ <link>http://eco.netvibes.com</link>
+ <description><![CDATA[Netvibes ecosystem latest all]]></description>
+ <pubDate>Tue, 20 Nov 2007 10:40:47 +0000</pubDate>
+ <generator>Netvibes Ecosystem</generator>
+
+ <docs>http://blogs.law.harvard.edu/tech/rss</docs>
+ <item>
+ <title><![CDATA[Petites vadrouilles en Asie du Sud-Est]]></title>
+ <link>http://eco.netvibes.com/2/206707</link>
+ <guid>http://eco.netvibes.com/2/206707</guid>
+ <description><![CDATA[Le récit, en direct ou presque, de mes voyages.]]></description>
+ <pubDate>Tue, 20 Nov 2007 03:32:43 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206707" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Zeus`s Blog]]></title>
+ <link>http://eco.netvibes.com/2/206706</link>
+ <guid>http://eco.netvibes.com/2/206706</guid>
+ <description><![CDATA[A security news blog including the range of subjects networking, virtualization, hardware and software..]]></description>
+
+ <pubDate>Tue, 20 Nov 2007 03:07:19 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206706" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[ArseSpeak]]></title>
+ <link>http://eco.netvibes.com/2/206703</link>
+ <guid>http://eco.netvibes.com/2/206703</guid>
+
+ <description><![CDATA[A fantastic Arsenal News and Discussion Blog. Updated everyday. Read away Gooners!]]></description>
+ <pubDate>Tue, 20 Nov 2007 00:05:50 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206703" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Vidéos Kayak]]></title>
+ <link>http://eco.netvibes.com/2/206699</link>
+
+ <guid>http://eco.netvibes.com/2/206699</guid>
+ <description><![CDATA[kayak videos website : freestyle, freeride, rivers,...]]></description>
+ <pubDate>Mon, 19 Nov 2007 21:24:29 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206699" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[BONJOUR ICI PIERRE VERCHEVAL]]></title>
+
+ <link>http://eco.netvibes.com/2/206698</link>
+ <guid>http://eco.netvibes.com/2/206698</guid>
+ <description><![CDATA[Le site québécois #1 portant sur la NFL!
+Recevez tous les articles et commentaires mordant de BIPV]]></description>
+ <pubDate>Mon, 19 Nov 2007 20:27:14 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206698" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[Cane - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206697</guid>
+ <description><![CDATA[Get all the latest full-length videos from Cane in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: Miami, CSI, CSI: NY, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 20:22:40 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206697" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[The Big Bang Theory - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206696</guid>
+ <description><![CDATA[Get all the latest full-length videos from The Big Bang Theory in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: Miami, CSI, CSI: NY, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 20:40:28 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206696" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[How I Met Your Mother - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206695</guid>
+ <description><![CDATA[Get all the latest full-length videos from How I Met Your Mother in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: Miami, CSI, CSI: NY, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 20:10:01 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206695" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Showbuzz - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206694</guid>
+ <description><![CDATA[Get all the latest full-length videos from Showbuzz in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: NY, CSI, CSI: Miami and more...]]></description>
+
+ <pubDate>Mon, 19 Nov 2007 20:02:13 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206694" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[CSI - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206693</guid>
+
+ <description><![CDATA[Get all the latest full-length videos from CSI in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: Miami, CSI: NY, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 19:49:12 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206693" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[CSI: NY - Full Length Videos]]></title>
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+
+ <guid>http://eco.netvibes.com/6/206692</guid>
+ <description><![CDATA[Get all the latest full-length videos from CSI: NY in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: Miami, CSI, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 19:48:33 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206692" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[CSI: Miami - Full Length Videos]]></title>
+
+ <link>http://www.netvibes.com/modules/multipleFeeds/multipleFeeds.php?provider=cbs</link>
+ <guid>http://eco.netvibes.com/6/206691</guid>
+ <description><![CDATA[Get all the latest full-length videos from CSI: Miami in this widget, as well as CBS News and some of the greatest shows from CBS like CSI: NY, CSI, Showbuzz and more...]]></description>
+ <pubDate>Mon, 19 Nov 2007 19:53:21 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206691" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[RATP bulletin trafic]]></title>
+ <link>http://www.netvibes.com/modules/webpage/webpage.php?url=http://wap.ratp.f...</link>
+ <guid>http://eco.netvibes.com/6/206690</guid>
+ <description><![CDATA[Etat des lieux complet sur le trafic des réseau métro, RER, bus, trams et trains de banlieue SNCF. ]]></description>
+ <pubDate>Mon, 19 Nov 2007 19:09:10 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206690" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[Off Topic ]]></title>
+ <link>http://eco.netvibes.com/2/206689</link>
+ <guid>http://eco.netvibes.com/2/206689</guid>
+ <description><![CDATA[Forum Off Topic di WinTricks RSS feed
+Politica arte cultura di tutto un po']]></description>
+ <pubDate>Mon, 19 Nov 2007 17:51:21 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206689" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[Europe1": Media]]></title>
+ <link>http://eco.netvibes.com/4/206687</link>
+ <guid>http://eco.netvibes.com/4/206687</guid>
+ <description><![CDATA[Link to "Media" show from Europe1 (daily show with Jean-Mard Morandini).]]></description>
+ <pubDate>Mon, 19 Nov 2007 17:01:49 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206687" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[RTL : Autoradio Express]]></title>
+ <link>http://eco.netvibes.com/4/206686</link>
+ <guid>http://eco.netvibes.com/4/206686</guid>
+ <description><![CDATA[Link to "Audio Radio Express" podcast.]]></description>
+
+ <pubDate>Mon, 19 Nov 2007 17:00:02 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206686" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[RTL : Le journal économique]]></title>
+ <link>http://eco.netvibes.com/4/206685</link>
+ <guid>http://eco.netvibes.com/4/206685</guid>
+
+ <description><![CDATA[Daily economic news from Frenc radio RTL.]]></description>
+ <pubDate>Mon, 19 Nov 2007 16:58:18 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206685" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[RTL : Autoradio]]></title>
+ <link>http://eco.netvibes.com/4/206684</link>
+
+ <guid>http://eco.netvibes.com/4/206684</guid>
+ <description><![CDATA[This is the podcast of "Auto-radio" from RTL.]]></description>
+ <pubDate>Mon, 19 Nov 2007 16:56:44 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206684" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[RTL : Un jour une histoire]]></title>
+
+ <link>http://eco.netvibes.com/4/206682</link>
+ <guid>http://eco.netvibes.com/4/206682</guid>
+ <description><![CDATA[This is the podcast "Un jour une histoire" from RTF (French radio)]]></description>
+ <pubDate>Mon, 19 Nov 2007 16:54:52 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206682" type="image/jpeg" length=""/>
+ </item>
+ <item>
+
+ <title><![CDATA[Mba E-business ESG]]></title>
+ <link>http://eco.netvibes.com/2/206675</link>
+ <guid>http://eco.netvibes.com/2/206675</guid>
+ <description><![CDATA[Portail du MBA E Business ESG, l'actualité Digital média économie, widgets, ecommerce, seo, social networks, buzz marketing, net éco du developpement durable, gadgets...vue par les élèves
+]]></description>
+ <pubDate>Mon, 19 Nov 2007 15:19:30 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206675" type="image/jpeg" length=""/>
+ </item>
+
+ <item>
+ <title><![CDATA[Rhône FM]]></title>
+ <link>http://eco.netvibes.com/7/206674</link>
+ <guid>http://eco.netvibes.com/7/206674</guid>
+ <description></description>
+ <pubDate>Mon, 19 Nov 2007 14:54:03 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206674" type="image/jpeg" length=""/>
+
+ </item>
+ <item>
+ <title><![CDATA[Developpeur Web]]></title>
+ <link>http://eco.netvibes.com/4/206673</link>
+ <guid>http://eco.netvibes.com/4/206673</guid>
+ <description><![CDATA[Blog professionnel d'un développeur et concepteur d'applications web. Codes, librairies, idées et opinions.
+Auteur de Webappkit, QuizzGeek]]></description>
+ <pubDate>Mon, 19 Nov 2007 14:46:45 +0000</pubDate>
+
+ <enclosure url="http://eco.netvibes.com/thumb/206673" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Ececik.Com]]></title>
+ <link>http://eco.netvibes.com/2/206672</link>
+ <guid>http://eco.netvibes.com/2/206672</guid>
+ <description><![CDATA[Çocuk Gelişimi ve Güncel Haberler]]></description>
+
+ <pubDate>Mon, 19 Nov 2007 14:32:27 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206672" type="image/jpeg" length=""/>
+ </item>
+ <item>
+ <title><![CDATA[Trading et conseils sur PERNOD-RICARD]]></title>
+ <link>http://eco.netvibes.com/2/206671</link>
+ <guid>http://eco.netvibes.com/2/206671</guid>
+
+ <description><![CDATA[Blog d'un robot trader spécialisé.
+Découvrez tous les jours ses prévisions boursières et ses positions en cours sur PERNOD-RICARD!]]></description>
+ <pubDate>Mon, 19 Nov 2007 14:18:31 +0000</pubDate>
+ <enclosure url="http://eco.netvibes.com/thumb/206671" type="image/jpeg" length=""/>
+ </item>
+ </channel>
+</rss>
16 years, 7 months
JBoss Portal SVN: r9034 - in branches/JBoss_Portal_Branch_2_6/widget: src/main/org/jboss/portal/test/widget/google and 10 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-11-20 08:49:23 -0500 (Tue, 20 Nov 2007)
New Revision: 9034
Added:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/ServerResponseTestCase.java
Removed:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/Foo3TestCase.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesWidgetRenderTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_6/widget/.classpath
branches/JBoss_Portal_Branch_2_6/widget/build.xml
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/QueryResultParserTestCase.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/JSONBuilderTestCase.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/widget/AbstractWidgetProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/DirectoryQueryResult.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/provider/GGProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResult.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/GGQueryResultEntry.java
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/GGWidgetMapEntry.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/provider/NetvibesJSONInfoBuilder.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResult.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResultBuilder.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesWidgetMapEntry.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
branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response8
Log:
JBPORTAL-1613: improved failures, error messages, added specific exceptions and additional test cases
Modified: branches/JBoss_Portal_Branch_2_6/widget/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/.classpath 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/.classpath 2007-11-20 13:49:23 UTC (rev 9034)
@@ -3,12 +3,11 @@
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
- <classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/backport-concurrent/lib/jboss-backport-concurrent.jar"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-jsr168api-lib.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/module-common"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-11-20 13:49:23 UTC (rev 9034)
@@ -168,6 +168,7 @@
<mkdir dir="${build.lib}"/>
<jar jarfile="${build.lib}/portal-widget-lib.jar">
<fileset dir="${build.classes}" includes="org/jboss/portal/widget/*.class"/>
+ <fileset dir="${build.classes}" includes="org/jboss/portal/widget/exceptions/*.class"/>
</jar>
<jar jarfile="${build.lib}/portal-widget-google-lib.jar">
@@ -282,14 +283,14 @@
-->
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.widget.google.Foo3TestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.NetvibesProviderTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.NetvibesWidgetRenderTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.widget.google.QueryResultParserTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.widget.google.PreferencesTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.widget.google.GGQueryTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.JSONBuilderTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.NetvibesQueryTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.NetvibesQueryResultTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.widget.google.ServerResponseTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.widget.netvibes.NetvibesProviderTestCase"/>
</x-test>
<x-classpath>
<!--
Deleted: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/Foo3TestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/Foo3TestCase.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/Foo3TestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -1,227 +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.test.widget.google;
-
-import java.net.URL;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.portal.test.widget.support.AbstractSynchronizedServer;
-import org.jboss.portal.test.widget.support.TestQuery;
-import org.jboss.portal.widget.DirectoryQueryResultEntry;
-import org.jboss.portal.widget.Widget;
-import org.jboss.portal.widget.WidgetProvider;
-import org.jboss.portal.widget.google.provider.GGProvider;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class Foo3TestCase extends TestCase
-{
-
- public void test01() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult1.xml")
- {
- protected void doClient() throws Exception
- {
-
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- TestQuery q = new TestQuery();
-
- List<DirectoryQueryResultEntry> w = provider.search(q);
-
- provider.stop();
- assertEquals(24, w.size());
-
- }
- };
- server.performInteraction();
- }
-
-
- public void test02() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult2.xml")
- {
- protected void doClient() throws Exception
- {
-
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- TestQuery q = new TestQuery();
-
- List<DirectoryQueryResultEntry> w = provider.search(q);
-
- provider.stop();
- assertEquals(24, w.size());
- }
- };
- server.performInteraction();
- }
-
- public void test03_fail() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult3_fail.xml")
- {
- protected void doClient() throws Exception
- {
-
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- TestQuery q = new TestQuery();
-
- List<DirectoryQueryResultEntry> w = provider.search(q);
-
- provider.stop();
- assertEquals(0, w.size());
-
- }
- };
- server.performInteraction();
- }
-
-
- public void test03_timeout() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8181)
- {
- protected void doClient() throws Exception
- {
- WidgetProvider provider = new GGProvider();
- provider.start();
- TestQuery q = new TestQuery();
- List<DirectoryQueryResultEntry> w = provider.search(q);
-
- provider.stop();
- assertEquals(0, w.size());
- }
- };
- server.performInteraction();
- }
-
- public void test404() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.Abstract404Server(8181)
- {
- protected void doClient() throws Exception
- {
- WidgetProvider provider = new GGProvider();
- provider.start();
- TestQuery q = new TestQuery();
- List<DirectoryQueryResultEntry> w = provider.search(q);
-
- provider.stop();
- assertEquals(0, w.size());
- }
- };
- server.performInteraction();
- }
-
-
- public void test_widget404() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.Abstract404Server(8181)
- {
- protected void doClient() throws Exception
- {
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- URL url = new URL("http://localhost:8181");
- Widget w = provider.getWidget(url);
-
- provider.stop();
-
- assertNull(w);
- }
- };
- server.performInteraction();
- }
-
- public void test_widget_wrong_content() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/gadget1_fail.xml")
- {
- protected void doClient() throws Exception
- {
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- URL url = new URL("http://localhost:8181");
- Widget w = provider.getWidget(url);
-
- provider.stop();
-
- assertNull(w);
- }
- };
- server.performInteraction();
- }
-
- public void test_widget_timeout() throws Exception
- {
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8181)
- {
- protected void doClient() throws Exception
- {
- WidgetProvider provider = new GGProvider();
- provider.start();
-
- URL url = new URL("http://localhost:8181");
- Widget w = provider.getWidget(url);
-
- provider.stop();
-
- assertNull(w);
- }
- };
- server.performInteraction();
- }
-
-
- public void test_widget_no_server() throws Exception
- {
- WidgetProvider provider = new GGProvider();
-
- try
- {
- provider.start();
-
- URL url= new URL("http://localhost:8181");
- Widget w = provider.getWidget(url);
- assertNull(w);
- }
- finally
- {
- provider.stop();
- }
- }
-}
-
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -24,6 +24,7 @@
import junit.framework.TestCase;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.widget.exceptions.WidgetNotSupportedException;
import org.jboss.portal.widget.google.info.GGPreferenceInfo;
import org.jboss.portal.widget.google.info.GGPreferencesInfo;
import org.jboss.portal.widget.google.info.GGWidgetInfo;
@@ -140,30 +141,39 @@
assertEquals(DataType.LOCATION, pi.getType().getOrdinal());
}
- /* - urlparam not supported for now
+
public void testUserPrefs03() throws Exception
{
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
URL url = tcl.getResource("google/gadget3.xml");
GGWidgetInfoBuilder ggwb = constructBuilder(url);
- GGWidgetInfo ggw = ggwb.create();
-
- assertNotNull(ggw);
+ try
+ {
+ GGWidgetInfo ggw = ggwb.create();
+ }
+ catch (WidgetNotSupportedException e)
+ {
+ // ok urlparam not supported for now
+ }
}
- // same here
public void testUserPrefs05() throws Exception
{
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
URL url = tcl.getResource("google/gadget5.xml");
GGWidgetInfoBuilder ggwb = constructBuilder(url);
- GGWidgetInfo ggw = ggwb.create();
+ try
+ {
+ GGWidgetInfo ggw = ggwb.create();
+ }
+ catch (WidgetNotSupportedException e)
+ {
+ // ok urlparam not supported for now
+ }
+ }
- assertNotNull(ggw);
- }
-*/
public void testUserPrefs04() throws Exception
{
@@ -241,17 +251,24 @@
assertNotNull(ggw);
}
- public GGWidgetInfoBuilder constructBuilder(URL url) throws Exception
+ public GGWidgetInfoBuilder constructBuilder(URL url) throws IllegalArgumentException
{
return new GGWidgetInfoBuilder(url)
{
- protected byte[] obtainWidget(URL url) throws Exception
+ protected byte[] obtainWidget(URL url) throws IllegalArgumentException
{
- File file = new File(url.getPath());
- InputStream io = new FileInputStream(file);
- byte[] bytes = IOTools.getBytes(io);
- io.close();
- return bytes;
+ try
+ {
+ File file = new File(url.getPath());
+ InputStream io = new FileInputStream(file);
+ byte[] bytes = IOTools.getBytes(io);
+ io.close();
+ return bytes;
+ }
+ catch(Exception e)
+ {
+ throw new IllegalArgumentException("Could not read file: "+ url.toString());
+ }
}
};
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -23,6 +23,8 @@
package org.jboss.portal.test.widget.google;
import junit.framework.TestCase;
+
+import org.jboss.portal.widget.exceptions.WidgetException;
import org.jboss.portal.widget.google.provider.GGQueryResult;
import org.jboss.portal.widget.google.provider.GGQueryResultBuilder;
import org.jboss.portal.widget.google.provider.GGQueryResultEntry;
@@ -40,75 +42,98 @@
public void testA() throws MalformedURLException
{
-
- URL url = this.getFileURL("google/queryresult1.xml");
- assertNotNull(url);
- GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
- GGQueryResult result = builder.build(5000);
- assertNotNull(result);
- assertEquals(24, result.collection().size());
- Iterator i = result.entries();
- assertNotNull(i);
- assertTrue(i.hasNext());
- GGQueryResultEntry entry = (GGQueryResultEntry)i.next();
- assertNotNull(entry);
- assertEquals("Date & Time", entry.getTitle());
- assertEquals("Add a clock to your page. Click edit to change it to the color of your choice.", entry.getDescription());
- assertEquals("http://www.google.com/ig/modules/datetime.png", entry.getScreenshot());
- assertEquals("http://www.google.com/ig/modules/datetime-thm.png", entry.getThumbnail());
- assertEquals("matt.feedback+datetime(a)gmail.com", entry.getAuthor());
- assertEquals(320, entry.getWidth());
- assertEquals(136, entry.getHeight());
- assertEquals(new URL("http://www.google.com/ig/modules/datetime.xml"), entry.getURL());
-
- GGQueryResultEntry entry2 = (GGQueryResultEntry)i.next();
- assertNotNull(entry2);
- assertEquals("Search YouTube", entry2.getTitle());
- assertEquals("A search module, which searches YouTube by tags.", entry2.getDescription());
- assertEquals("http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc.png", entry2.getScreenshot());
- assertEquals("http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc-thm...", entry2.getThumbnail());
- assertEquals("http://throttled.org/googlegadgets/youtubesearch.xml", entry2.getURL().toString());
-
- GGQueryResultEntry entry3 = (GGQueryResultEntry)i.next();
- assertNotNull(entry3);
- assertEquals("PacMan v2.4", entry3.getTitle());
- assertEquals(new URL("http://www.schulz.dk/pacman.xml"), entry3.getURL());
+ try
+ {
+ URL url = this.getFileURL("google/queryresult1.xml");
+ assertNotNull(url);
+ GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
+ GGQueryResult result = builder.build(5000);
+ assertNotNull(result);
+ assertEquals(24, result.collection().size());
+ Iterator i = result.entries();
+ assertNotNull(i);
+ assertTrue(i.hasNext());
+ GGQueryResultEntry entry = (GGQueryResultEntry)i.next();
+ assertNotNull(entry);
+ assertEquals("Date & Time", entry.getTitle());
+ assertEquals("Add a clock to your page. Click edit to change it to the color of your choice.", entry.getDescription());
+ assertEquals("http://www.google.com/ig/modules/datetime.png", entry.getScreenshot());
+ assertEquals("http://www.google.com/ig/modules/datetime-thm.png", entry.getThumbnail());
+ assertEquals("matt.feedback+datetime(a)gmail.com", entry.getAuthor());
+ assertEquals(320, entry.getWidth());
+ assertEquals(136, entry.getHeight());
+ assertEquals(new URL("http://www.google.com/ig/modules/datetime.xml"), entry.getURL());
+
+ GGQueryResultEntry entry2 = (GGQueryResultEntry)i.next();
+ assertNotNull(entry2);
+ assertEquals("Search YouTube", entry2.getTitle());
+ assertEquals("A search module, which searches YouTube by tags.", entry2.getDescription());
+ assertEquals("http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc.png", entry2.getScreenshot());
+ assertEquals("http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc-thm...", entry2.getThumbnail());
+ assertEquals("http://throttled.org/googlegadgets/youtubesearch.xml", entry2.getURL().toString());
+
+ GGQueryResultEntry entry3 = (GGQueryResultEntry)i.next();
+ assertNotNull(entry3);
+ assertEquals("PacMan v2.4", entry3.getTitle());
+ assertEquals(new URL("http://www.schulz.dk/pacman.xml"), entry3.getURL());
+ }
+ catch(WidgetException e)
+ {
+ e.printStackTrace();
+ fail();
+ }
}
public void test02() throws MalformedURLException
{
- URL url = this.getFileURL("google/queryresult2.xml");
- assertNotNull(url);
- GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
- GGQueryResult result = builder.build(5000);
- assertNotNull(result);
- Iterator i = result.entries();
- assertNotNull(i);
- assertEquals(24, result.collection().size());
- assertTrue(i.hasNext());
- GGQueryResultEntry entry = (GGQueryResultEntry)i.next();
- assertNotNull(entry);
- assertEquals("Wikipedia", entry.getTitle());
- assertEquals(new URL("http://homepages.ipact.nl/~kruit/benno/folder/Documents/Google/wpsearchba..."), entry.getURL());
- assertEquals("A Wikipedia Search and Go widget. Language choice.", entry.getDescription());
- assertEquals("http://www.google.com/ig/modules/ov/module_wikipedia_full.png", entry.getScreenshot());
- assertEquals("http://www.google.com/ig/modules/ov/module_wikipedia.png", entry.getThumbnail());
- assertEquals("bennokr+be_gone_spammers(a)gmail.com", entry.getAuthor());
- assertEquals(320, entry.getWidth());
- assertEquals(40, entry.getHeight());
-
- GGQueryResultEntry entry2 = (GGQueryResultEntry)i.next();
- assertNotNull(entry2);
+ try
+ {
+ URL url = this.getFileURL("google/queryresult2.xml");
+ assertNotNull(url);
+ GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
+ GGQueryResult result = builder.build(5000);
+ assertNotNull(result);
+ Iterator i = result.entries();
+ assertNotNull(i);
+ assertEquals(24, result.collection().size());
+ assertTrue(i.hasNext());
+ GGQueryResultEntry entry = (GGQueryResultEntry)i.next();
+ assertNotNull(entry);
+ assertEquals("Wikipedia", entry.getTitle());
+ assertEquals(new URL("http://homepages.ipact.nl/~kruit/benno/folder/Documents/Google/wpsearchba..."), entry.getURL());
+ assertEquals("A Wikipedia Search and Go widget. Language choice.", entry.getDescription());
+ assertEquals("http://www.google.com/ig/modules/ov/module_wikipedia_full.png", entry.getScreenshot());
+ assertEquals("http://www.google.com/ig/modules/ov/module_wikipedia.png", entry.getThumbnail());
+ assertEquals("bennokr+be_gone_spammers(a)gmail.com", entry.getAuthor());
+ assertEquals(320, entry.getWidth());
+ assertEquals(40, entry.getHeight());
+
+ GGQueryResultEntry entry2 = (GGQueryResultEntry)i.next();
+ assertNotNull(entry2);
+ }
+ catch(WidgetException e)
+ {
+ e.printStackTrace();
+ fail();
+ }
}
public void test03()
{
- URL url = this.getFileURL("google/queryresult3_fail.xml");
- assertNotNull(url);
- GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
- GGQueryResult result = builder.build(5000);
- assertNotNull(result);
- assertEquals(0, result.collection().size());
+ try
+ {
+ URL url = this.getFileURL("google/queryresult3_fail.xml");
+ assertNotNull(url);
+ GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
+ GGQueryResult result = builder.build(5000);
+ assertNotNull(result);
+ assertEquals(0, result.collection().size());
+ fail();
+ }
+ catch(WidgetException e)
+ {
+ // ok
+ }
}
private URL getFileURL(String filename)
Added: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/ServerResponseTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/ServerResponseTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/ServerResponseTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -0,0 +1,340 @@
+/******************************************************************************
+ * 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.test.widget.google;
+
+import junit.framework.TestCase;
+
+import org.jboss.portal.test.widget.support.AbstractSynchronizedServer;
+import org.jboss.portal.test.widget.support.TestQuery;
+import org.jboss.portal.widget.DirectoryQueryResult;
+import org.jboss.portal.widget.Widget;
+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.exceptions.WidgetFailure;
+import org.jboss.portal.widget.exceptions.WidgetFetchException;
+import org.jboss.portal.widget.exceptions.WidgetMetaDataParseException;
+import org.jboss.portal.widget.google.provider.GGProvider;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ServerResponseTestCase extends TestCase
+{
+
+ public void test01() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult1.xml")
+ {
+ protected void doClient() throws Exception
+ {
+
+ WidgetProvider provider = new GGProvider();
+ provider.start();
+
+ TestQuery q = new TestQuery();
+
+ DirectoryQueryResult w = provider.search(q);
+
+ provider.stop();
+ assertEquals(24, w.resultSize());
+ }
+ };
+ server.performInteraction();
+ }
+
+
+ public void test02() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult2.xml")
+ {
+ protected void doClient() throws Exception
+ {
+
+ WidgetProvider provider = new GGProvider();
+ provider.start();
+
+ TestQuery q = new TestQuery();
+
+ DirectoryQueryResult w = provider.search(q);
+
+ provider.stop();
+ assertEquals(24, w.resultSize());
+ }
+ };
+ server.performInteraction();
+ }
+
+ public void test03_fail() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/queryresult3_fail.xml")
+ {
+ protected void doClient() throws Exception
+ {
+
+ WidgetProvider provider = new GGProvider();
+ provider.start();
+
+ TestQuery q = new TestQuery();
+
+ DirectoryQueryResult w = provider.search(q);
+
+ provider.stop();
+ assertEquals(0, w.resultSize());
+ if ( w instanceof DirectoryResultFailure)
+ {
+ DirectoryResultFailure r = (DirectoryResultFailure) w;
+ if ( r.getCause() instanceof WidgetException)
+ {
+ // ok
+ }
+ else
+ {
+ fail("Exception must be of type WidgetException");
+ }
+ }
+ else
+ {
+ fail("Directory lookup must fail.");
+ }
+
+ }
+ };
+ server.performInteraction();
+ }
+
+
+ public void test03_timeout() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new GGProvider();
+ provider.start();
+ TestQuery q = new TestQuery();
+ DirectoryQueryResult w = provider.search(q);
+
+ provider.stop();
+ assertEquals(0, w.resultSize());
+ if ( w instanceof DirectoryResultFailure)
+ {
+ DirectoryResultFailure r = (DirectoryResultFailure) w;
+ if ( r.getCause() instanceof WidgetException)
+ {
+ // ok
+ }
+ else
+ {
+ fail("Exception must be of type WidgetException");
+ }
+ }
+ else
+ {
+ fail("Directory lookup must fail.");
+ }
+ }
+ };
+ server.performInteraction();
+ }
+
+ public void test404() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.Abstract404Server(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new GGProvider();
+ provider.start();
+ TestQuery q = new TestQuery();
+ DirectoryQueryResult w = provider.search(q);
+
+ provider.stop();
+ assertEquals(0, w.resultSize());
+ if ( w instanceof DirectoryResultFailure)
+ {
+ DirectoryResultFailure r = (DirectoryResultFailure) w;
+ if ( r.getCause() instanceof WidgetException)
+ {
+ // ok
+ }
+ else
+ {
+ fail("Exception must be of type WidgetException");
+ }
+ }
+ else
+ {
+ fail("Directory lookup must fail.");
+ }
+ }
+ };
+ server.performInteraction();
+ }
+
+
+ public void test_widget404() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.Abstract404Server(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ GGProvider provider = new GGProvider();
+ provider.start();
+
+ Widget w = provider.getWidget("http://localhost:8181");
+
+ provider.stop();
+
+ assertNotNull(w);
+ if ( w instanceof WidgetFailure)
+ {
+ WidgetFailure wf = (WidgetFailure) w;
+ if ( wf.getCause() instanceof WidgetException)
+ {
+ WidgetFetchException fe = (WidgetFetchException) wf.getCause();
+ // ok
+ }
+ else
+ {
+ fail("Exception type must be of WidgetException");
+ }
+ }
+ else
+ {
+ fail("Widget must fail.");
+ }
+ }
+ };
+ server.performInteraction();
+ }
+
+ public void test_widget_wrong_content() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "google/gadget1_fail.xml")
+ {
+ protected void doClient() throws Exception
+ {
+ GGProvider provider = new GGProvider();
+ provider.start();
+
+ Widget w = provider.getWidget("http://localhost:8181");
+
+ provider.stop();
+
+ assertNotNull(w);
+ if ( w instanceof WidgetFailure)
+ {
+ WidgetFailure wf = (WidgetFailure) w;
+ if ( wf.getCause() instanceof WidgetException)
+ {
+ WidgetMetaDataParseException me = (WidgetMetaDataParseException) wf.getCause();
+ // ok
+ }
+ else
+ {
+ fail("Exception type must be of WidgetException");
+ }
+ }
+ else
+ {
+ fail("Widget must fail.");
+ }
+ }
+ };
+ server.performInteraction();
+ }
+
+ public void test_widget_timeout() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ GGProvider provider = new GGProvider();
+ provider.start();
+
+ Widget w = provider.getWidget("http://localhost:8181");
+
+ provider.stop();
+
+ assertNotNull(w);
+ if ( w instanceof WidgetFailure)
+ {
+ WidgetFailure wf = (WidgetFailure) w;
+ if ( wf.getCause() instanceof WidgetException)
+ {
+ WidgetFetchException fe = (WidgetFetchException) wf.getCause();
+ // ok
+ }
+ else
+ {
+ fail("Exception type must be of WidgetException");
+ }
+ }
+ else
+ {
+ fail("Widget must fail.");
+ }
+ }
+ };
+ server.performInteraction();
+ }
+
+
+ public void test_widget_no_server() throws Exception
+ {
+ GGProvider provider = new GGProvider();
+
+ try
+ {
+ provider.start();
+
+ Widget w = provider.getWidget("http://localhost:8181");
+ assertNotNull(w);
+ if ( w instanceof WidgetFailure)
+ {
+ WidgetFailure wf = (WidgetFailure) w;
+ if ( wf.getCause() instanceof WidgetException)
+ {
+ WidgetFetchException fe = (WidgetFetchException) wf.getCause();
+ // ok
+ }
+ else
+ {
+ fail("Exception type must be of WidgetException");
+ }
+ }
+ else
+ {
+ fail("Widget must fail.");
+ }
+ }
+ finally
+ {
+ provider.stop();
+ }
+ }
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/JSONBuilderTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/JSONBuilderTestCase.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/JSONBuilderTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -24,10 +24,15 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.widget.exceptions.WidgetException;
+import org.jboss.portal.widget.exceptions.WidgetNotSupportedException;
import org.jboss.portal.widget.netvibes.NetvibesPreferenceInfo;
import org.jboss.portal.widget.netvibes.NetvibesPreferencesInfo;
import org.jboss.portal.widget.netvibes.NetvibesWidgetInfo;
@@ -252,20 +257,53 @@
}
}
+ public void test08()
+ {
+ try
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ URL url = tcl.getResource("netvibes/json.response_fail");
+
+ NetvibesJSONInfoBuilder builder = constructBuilder(url);
+ builder.create();
+ fail();
+ }
+ catch (WidgetException e)
+ {
+ if ( e instanceof WidgetNotSupportedException)
+ {
+ // okay
+ }
+ else
+ {
+ fail("Widget should not be supported if apiVersion < 1");
+ }
+ }
+ }
-
public NetvibesJSONInfoBuilder constructBuilder(URL url)
{
return new NetvibesJSONInfoBuilder(url)
{
@Override
- protected byte[] obtainWidget(URL url) throws Exception
+ protected byte[] obtainWidget(URL url) throws IllegalArgumentException, MalformedURLException
{
- File file = new File(url.getPath());
- InputStream io = new FileInputStream(file);
- byte[] bytes = IOTools.getBytes(io);
- io.close();
- return bytes;
+ try
+ {
+ File file = new File(url.getPath());
+ InputStream io = new FileInputStream(file);
+ byte[] bytes = IOTools.getBytes(io);
+ io.close();
+ return bytes;
+ }
+ catch(FileNotFoundException e)
+ {
+ throw new IllegalArgumentException("File not found: "+ url.toString(), e);
+ }
+ catch(IOException e)
+ {
+ throw new IllegalArgumentException("IOException while reading: "+ url.toString(), e);
+ }
}
};
}
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesProviderTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -24,7 +24,10 @@
import junit.framework.TestCase;
-import org.jboss.portal.widget.Widget;
+import org.jboss.portal.test.widget.support.AbstractSynchronizedServer;
+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.netvibes.provider.NetvibesProvider;
/**
@@ -34,17 +37,83 @@
public class NetvibesProviderTestCase extends TestCase
{
- public void test01()
+ public void test01() throws Exception
{
- NetvibesProvider provider = new NetvibesProvider();
- provider.start();
-
- Widget widget = provider.getWidget("http://www.netvibes.com/api/uwa/examples/alexa.html");
- assertNotNull(widget);
-// System.out.println(widget.render(new HashMap()));
-
- provider.stop();
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "netvibes/queryresult_1.xml")
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new NetvibesProvider();
+ provider.start();
+
+ TestQuery query = new TestQuery();
+
+ DirectoryQueryResult result = provider.search(query);
+ provider.stop();
+
+ assertEquals(10, result.resultSize());
+ }
+
+ };
+ server.performInteraction();
}
+
+ public void test02() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractReturnFileServer(8181, "netvibes/queryresult_1_fail.xml")
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new NetvibesProvider();
+ provider.start();
+ TestQuery query = new TestQuery();
+
+ DirectoryQueryResult result = provider.search(query);
+ provider.stop();
+
+ assertEquals(0, result.resultSize());
+ }
+ };
+ server.performInteraction();
+ }
+
+ public void test03() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new NetvibesProvider();
+ provider.start();
+ TestQuery query = new TestQuery();
+
+ DirectoryQueryResult result = provider.search(query);
+ provider.stop();
+
+ assertEquals(0, result.resultSize());
+ }
+ };
+ server.performInteraction();
+ }
+
+
+ public void test404() throws Exception
+ {
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.Abstract404Server(8181)
+ {
+ protected void doClient() throws Exception
+ {
+ WidgetProvider provider = new NetvibesProvider();
+ provider.start();
+ TestQuery query = new TestQuery();
+
+ DirectoryQueryResult result = provider.search(query);
+ provider.stop();
+
+ assertEquals(0, result.resultSize());
+ }
+ };
+ 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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesQueryResultTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -27,6 +27,7 @@
import junit.framework.TestCase;
+import org.jboss.portal.widget.exceptions.WidgetException;
import org.jboss.portal.widget.netvibes.provider.NetvibesQueryResult;
import org.jboss.portal.widget.netvibes.provider.NetvibesQueryResultBuilder;
import org.jboss.portal.widget.netvibes.provider.NetvibesQueryResultEntry;
@@ -40,6 +41,8 @@
public void test01()
{
+ try
+ {
URL url = this.getFileURL("netvibes/queryresult_1.xml");
assertNotNull(url);
NetvibesQueryResultBuilder builder = new NetvibesQueryResultBuilder(url);
@@ -90,8 +93,48 @@
assertNotNull(entry);
assertFalse(i.hasNext());
+ }
+ catch(WidgetException e)
+ {
+ e.printStackTrace();
+ fail();
+ }
}
+
+ public void test02()
+ {
+ try
+ {
+ URL url = this.getFileURL("netvibes/queryresult_2.xml");
+ assertNotNull(url);
+ NetvibesQueryResultBuilder builder = new NetvibesQueryResultBuilder(url);
+ NetvibesQueryResult result = builder.build(5000);
+ assertNotNull(result);
+ }
+ catch(WidgetException e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+ }
+ public void test03_fail()
+ {
+ try
+ {
+ URL url = this.getFileURL("netvibes/queryresult_2_fail.xml");
+ assertNotNull(url);
+ NetvibesQueryResultBuilder builder = new NetvibesQueryResultBuilder(url);
+ NetvibesQueryResult result = builder.build(5000);
+ assertNotNull(result);
+ fail();
+ }
+ catch(Exception e)
+ {
+ // ok
+ }
+ }
+
private URL getFileURL(String filename)
{
return Thread.currentThread().getContextClassLoader().getResource(filename);
Deleted: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesWidgetRenderTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesWidgetRenderTestCase.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/netvibes/NetvibesWidgetRenderTestCase.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -1,88 +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.test.widget.netvibes;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.widget.netvibes.NetvibesWidget;
-import org.jboss.portal.widget.netvibes.NetvibesWidgetInfo;
-import org.jboss.portal.widget.netvibes.provider.NetvibesJSONInfoBuilder;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class NetvibesWidgetRenderTestCase extends TestCase
-{
-
- public void test01()
- {
- try
- {
- NetvibesWidget widget = new NetvibesWidget(
- new URL("http://www.netvibes.com/api/uwa/examples/alexa.html"),
- getWidgetInfo("netvibes/json.response1")
- );
- assertNotNull(widget);
-// System.out.println(widget.render(new HashMap()));
- }
- catch(Exception e)
- {
- e.printStackTrace();
- fail();
- }
- }
-
-
- private NetvibesWidgetInfo getWidgetInfo(String file) throws Exception
- {
- ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- URL url = tcl.getResource( file );
-
- NetvibesJSONInfoBuilder builder = constructBuilder(url);
- return builder.create();
- }
-
- public NetvibesJSONInfoBuilder constructBuilder(URL url)
- {
- return new NetvibesJSONInfoBuilder(url)
- {
-
- protected byte[] obtainWidget(URL url) throws Exception
- {
- File file = new File(url.getPath());
- InputStream io = new FileInputStream(file);
- byte[] bytes = IOTools.getBytes(io);
- io.close();
- return bytes;
- }
- };
- }
-}
-
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/AbstractWidgetProvider.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -22,13 +22,10 @@
******************************************************************************/
package org.jboss.portal.widget;
+import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
@@ -36,6 +33,9 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import org.jboss.portal.widget.exceptions.DirectoryResultFailure;
+import org.jboss.portal.widget.exceptions.WidgetFailure;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -45,31 +45,34 @@
/** The widget entry map */
protected ConcurrentMap<URL, ExpiringFutureTask<Widget>> entries = new ConcurrentHashMap<URL, ExpiringFutureTask<Widget>>();
-
+
/** The query result map */
protected ConcurrentMap<WidgetQuery, ExpiringFutureTask<DirectoryQueryResult>> queries = new ConcurrentHashMap<WidgetQuery, ExpiringFutureTask<DirectoryQueryResult>>();
/** The executor */
protected ExecutorService executor;
-
+
/** 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 query expiration time in millis (default: 15 minutes) */
protected long queryExpiration = TimeUnit.MILLISECONDS.convert(900, TimeUnit.SECONDS);
-
+
/** Fetch all widgets in on the directory lookup */
private boolean fetchWidgetsOnDirectoryLookup = false;
-
+
/** The connection timeout */
protected int connectionTimeout = 5000;
-
+
/** Eviction thread timing */
protected long timing = TimeUnit.MILLISECONDS.convert(60, TimeUnit.SECONDS);
+ /** The logger */
+ private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(WidgetProvider.class);
+
public void start()
{
executor = new ThreadPoolExecutor(4, 4, 0, TimeUnit.SECONDS, new LinkedBlockingQueue());
@@ -78,7 +81,7 @@
scheduledExecutor.scheduleAtFixedRate(new EntryEvictionThread(), timing, timing, TimeUnit.MILLISECONDS);
scheduledExecutor.scheduleAtFixedRate(new QueryEvictionThread(), timing, timing, TimeUnit.MILLISECONDS);
}
-
+
public void stop()
{
executor.shutdownNow();
@@ -86,12 +89,12 @@
executor = null;
scheduledExecutor = null;
}
-
+
public long getConnectionTimeout()
{
return connectionTimeout;
}
-
+
public void setConnectionTimeout(int connectionTimeout)
{
this.connectionTimeout = connectionTimeout;
@@ -101,153 +104,112 @@
{
this.queryExpiration = millis;
}
-
+
public void setEntryExpiration(long millis)
{
this.entryExpiration = millis;
}
-
+
public void setFetchWidgetsOnDirectoryLookup(boolean fetch)
{
this.fetchWidgetsOnDirectoryLookup = fetch;
}
-
- /*
- private void addWidget(URL url)
+
+ /**
+ * Abstract method for adding a directory query and submitting to the executor
+ *
+ * @param query
+ */
+ protected abstract void addDirectoryResult(WidgetQuery query);
+
+ /**
+ * Abstract method for adding a widget url and submitting it to the executor
+ *
+ * @param url
+ */
+ protected abstract void addWidget(URL url);
+
+ /**
+ * Get widget (instance of WidgetFailure on failure)
+ *
+ * @param url
+ * @return Widget
+ */
+ public Widget getWidget(URL url)
{
- ExpiringFutureTask<Widget> ft = new ExpiringFutureTask<Widget>(entryExpiration, new WidgetMapEntry(url));
- ExpiringFutureTask<Widget> e = entries.putIfAbsent(url, ft);
- if (e == null)
+ addWidget(url);
+ ExpiringFutureTask<Widget> entry = entries.get(url);
+ try
{
- e = ft;
- executor.submit(e);
+ return entry.get();
}
+ catch (Exception e)
+ {
+ log.debug("Failed to get widget.", e.getCause());
+ entries.remove(entry);
+ return new WidgetFailure(url, e);
+ }
}
- */
- public Widget getWidget(URL url) throws InterruptedException, ExecutionException
- {
- addWidget(url);
- ExpiringFutureTask<Widget> e = entries.get(url);
- return e.get();
- }
-
+
public Widget getWidget(String string)
{
try
{
URL url = new URL(string);
+ // Get widget
return getWidget(url);
}
- catch(Exception e)
+ catch (MalformedURLException e)
{
- return null;
+ log.debug("Failed to create widget url out of String: " + string);
+ return new WidgetFailure(null, e);
}
}
-
- /*
- private void addDirectoryResult(WidgetQuery query)
+
+ private DirectoryQueryResult getDirectoryResult(WidgetQuery query)
{
- ExpiringFutureTask<DirectoryQueryResult> dt = new ExpiringFutureTask<DirectoryQueryResult>(queryExpiration, new DirectoryQueryMapEntry(query));
- ExpiringFutureTask<DirectoryQueryResult> e = queries.putIfAbsent(query, dt);
- if (e == null)
- {
- e = dt;
- executor.submit(e);
- }
- }
- */
- protected abstract void addDirectoryResult(WidgetQuery query);
-
- protected abstract void addWidget(URL url);
-
- private DirectoryQueryResult getDirectoryResult(WidgetQuery query) throws InterruptedException, ExecutionException
- {
addDirectoryResult(query);
- ExpiringFutureTask<DirectoryQueryResult> e = queries.get(query);
- return e.get();
- }
-
- public List<Widget> getWidgets(List<URL> list)
- {
- if (list == null)
+ ExpiringFutureTask<DirectoryQueryResult> entry = queries.get(query);
+ try
{
- throw new IllegalArgumentException();
+ return entry.get();
}
- for(URL url : list)
+ catch (Exception e)
{
- addWidget(url);
+ log.debug("Failed to retreive widget directory information", e);
+ return new DirectoryResultFailure(e);
}
- List<Widget> widgets = new ArrayList<Widget>();
-
- for(URL url : list)
- {
- try
- {
- Widget widget = getWidget(url);
- if ( widget != null)
- {
- widgets.add(widget);
- }
- }
- catch( InterruptedException e )
- {
- // log.err
- entries.remove(url);
- }
- catch( ExecutionException e )
- {
- // log.err
- entries.remove(url);
- }
- }
- return widgets;
}
- public List<DirectoryQueryResultEntry> search(WidgetQuery q)
+ public DirectoryQueryResult search(WidgetQuery q)
{
if (q == null)
{
- throw new IllegalArgumentException();
+ return new DirectoryResultFailure(new IllegalArgumentException("Query can not be null"));
}
- List<DirectoryQueryResultEntry> list = new ArrayList<DirectoryQueryResultEntry>();
- DirectoryQueryResult result = null;
- try
- {
- result = getDirectoryResult(q);
- for(Iterator<? extends DirectoryQueryResultEntry> i = result.entries(); i.hasNext(); )
- {
- list.add(i.next() );
- }
+
+ //
+ DirectoryQueryResult result = getDirectoryResult(q);
- }
- catch(InterruptedException e)
+ if (this.fetchWidgetsOnDirectoryLookup)
{
- // TODO
- }
- catch(ExecutionException e)
- {
- // TODO
- }
-
- if( this.fetchWidgetsOnDirectoryLookup )
- {
- for(URL url : result.collection())
+ for (URL url : result.collection())
{
// add widgets and submit to executor if necessary
addWidget(url);
}
}
- return list;
+ return result;
}
-
+
private class EntryEvictionThread implements Runnable
{
public void run()
{
- if(entries != null && entries.size() > 0)
+ if (entries != null && entries.size() > 0)
{
- for(URL url : entries.keySet())
+ for (URL url : entries.keySet())
{
ExpiringFutureTask<Widget> w = entries.get(url);
if (w.isExpired())
@@ -259,14 +221,14 @@
}
}
}
-
+
private class QueryEvictionThread implements Runnable
{
public void run()
{
if (queries != null && queries.size() > 0)
{
- for(WidgetQuery query : queries.keySet())
+ for (WidgetQuery query : queries.keySet())
{
ExpiringFutureTask<DirectoryQueryResult> e = queries.get(query);
if (e.isExpired())
@@ -278,4 +240,5 @@
}
}
}
+
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/DirectoryQueryResult.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/DirectoryQueryResult.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/DirectoryQueryResult.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -37,5 +37,6 @@
public List<URL> collection();
+ public int resultSize();
}
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetProvider.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -23,7 +23,6 @@
package org.jboss.portal.widget;
import java.net.URL;
-import java.util.List;
import java.util.concurrent.ExecutionException;
/**
@@ -39,10 +38,8 @@
public Widget getWidget(URL url) throws InterruptedException, ExecutionException;
- public List<Widget> getWidgets(List<URL> list);
+ public DirectoryQueryResult search(WidgetQuery query);
- public List<DirectoryQueryResultEntry> search(WidgetQuery query);
-
public void setConnectionTimeout(int connectionTimeout);
public void setQueryExpiration(long millis);
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/WidgetQuery.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -31,23 +31,8 @@
*/
public interface WidgetQuery
{
-
+
/** . */
-// public int getStart();
-
- /** . */
-// public int getNum();
-
- /** . */
-// public String getCat();
-
- /** . */
-// public String getQ();
-
- /** . */
-// public int hashCode();
-
- /** . */
public boolean equals(Object foo);
/** . */
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -58,7 +58,7 @@
@Override
protected final void addDirectoryResult(WidgetQuery query)
{
- ExpiringFutureTask<DirectoryQueryResult> dt = new ExpiringFutureTask<DirectoryQueryResult>(queryExpiration, new GGDirectoryQueryMapEntry(query, (int) connectionTimeout));
+ ExpiringFutureTask<DirectoryQueryResult> dt = new ExpiringFutureTask<DirectoryQueryResult>(queryExpiration, new GGDirectoryQueryMapEntry(query, connectionTimeout));
ExpiringFutureTask<DirectoryQueryResult> e = queries.putIfAbsent(query, dt);
if (e == null)
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResult.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResult.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResult.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -65,4 +65,10 @@
}
return list;
}
+
+ public int resultSize()
+ {
+ return entries.size();
+ }
+
}
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -25,8 +25,10 @@
import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.widget.WidgetQuery;
+import org.jboss.portal.widget.exceptions.WidgetException;
import org.jboss.portal.widget.google.directory.GGWidgetDirectoryFactory;
import org.jboss.portal.widget.google.metadata.GGWidgetMetaData;
+import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -37,9 +39,9 @@
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.Collections;
import java.util.List;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
/**
@@ -79,7 +81,7 @@
this.url = url;
}
- public GGQueryResult build(int connectionTimeout)
+ public GGQueryResult build(int connectionTimeout) throws WidgetException
{
try
{
@@ -107,7 +109,7 @@
//
if (bytes == null)
{
- throw new Exception("Cannot retrieve " + url);
+ throw new WidgetException("Cannot retrieve url: " + url);
}
String string = new String(bytes);
@@ -138,14 +140,15 @@
}
catch (SocketTimeoutException e)
{
- log.error("Query for google gadgets in directory failed due to timeout. Try to increase connectionTimeout initial parameter; ", e);
+ throw new WidgetException("Netvibes directory query failed due to timeout. Try to increase connectionTimeout initial parameter; ", e);
}
- catch (Exception e)
+ catch(JBossXBException e)
{
- log.error("Gadgets query failed: ", e);
+ throw new WidgetException("Failed to parse directory response.", e);
}
-
- //
- return new GGQueryResult(Collections.EMPTY_LIST);
+ catch(IOException e)
+ {
+ throw new WidgetException("Failed to perform directory lookup.", e);
+ }
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultEntry.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultEntry.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultEntry.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -25,6 +25,7 @@
import org.jboss.portal.widget.DirectoryQueryResultEntry;
import org.jboss.portal.widget.google.metadata.GGWidgetMetaData;
+import java.net.MalformedURLException;
import java.net.URL;
/**
@@ -79,7 +80,7 @@
this.height = height;
}
- public GGQueryResultEntry(GGWidgetMetaData metadata) throws Exception
+ public GGQueryResultEntry(GGWidgetMetaData metadata) throws NumberFormatException, MalformedURLException
{
this.url = new URL(metadata.getLink());
this.title = metadata.getTitle();
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -25,6 +25,10 @@
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.widget.exceptions.WidgetException;
+import org.jboss.portal.widget.exceptions.WidgetFetchException;
+import org.jboss.portal.widget.exceptions.WidgetMetaDataParseException;
+import org.jboss.portal.widget.exceptions.WidgetNotSupportedException;
import org.jboss.portal.widget.google.type.DataType;
import org.jboss.portal.widget.google.type.StringType;
import org.jboss.portal.widget.google.type.LocationType;
@@ -42,6 +46,8 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
+
+import java.net.MalformedURLException;
import java.net.URL;
import java.text.NumberFormat;
import java.util.Iterator;
@@ -81,24 +87,36 @@
}
/**
- * Build the widget info from the url or return null if it is not possible.
+ * Build the widget info from the url or throws an exception if it is not possible.
+ *
* @return the widget info
* @throws Exception
*/
- public GGWidgetInfo create() throws Exception
+ public GGWidgetInfo create() throws WidgetException, MalformedURLException
{
long millis = System.currentTimeMillis();
byte[] bytes = obtainWidget(url);
// No response was obtained
if (bytes == null)
{
- return null;
+ throw new WidgetFetchException("Could not retreive widget data.");
}
//
- DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(new ByteArrayInputStream(bytes));
+ DocumentBuilderFactory factory;
+ DocumentBuilder builder;
+ Document doc;
+ try
+ {
+ factory = XMLTools.getDocumentBuilderFactory();
+ builder = factory.newDocumentBuilder();
+ doc = builder.parse(new ByteArrayInputStream(bytes));
+ }
+ catch (Exception e)
+ {
+ throw new WidgetMetaDataParseException("Could not parse widget document.");
+ }
+ //
Element moduleElt = doc.getDocumentElement();
Map messagesBundle = new HashMap();
@@ -107,15 +125,15 @@
Iterator modulePrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "ModulePrefs");
if (modulePrefsEltIterator.hasNext())
{
- Element modulePrefsElt = (Element)modulePrefsEltIterator.next();
+ Element modulePrefsElt = (Element) modulePrefsEltIterator.next();
Iterator localeEltIterator = XMLTools.getChildrenIterator(modulePrefsElt, "Locale");
Map messages = new HashMap();
- while(localeEltIterator.hasNext())
+ while (localeEltIterator.hasNext())
{
- Element localeElt = (Element)localeEltIterator.next();
+ Element localeElt = (Element) localeEltIterator.next();
String langAttr = localeElt.getAttribute("lang");
String countryAttr = localeElt.getAttribute("country");
@@ -147,14 +165,24 @@
continue;
}
- DocumentBuilder bundleDocBuilder = factory.newDocumentBuilder();
- Document bundleDoc = bundleDocBuilder.parse(new ByteArrayInputStream(bundleBytes));
+ DocumentBuilder bundleDocBuilder;
+ Document bundleDoc;
+ try
+ {
+ bundleDocBuilder = factory.newDocumentBuilder();
+ bundleDoc = bundleDocBuilder.parse(new ByteArrayInputStream(bundleBytes));
+ }
+ catch (Exception e)
+ {
+ throw new WidgetMetaDataParseException("Could not parse bundles.");
+ }
+
Element messagebundleElt = bundleDoc.getDocumentElement();
Iterator messagesEltIterator = XMLTools.getChildrenIterator(messagebundleElt, "msg");
- while(messagesEltIterator.hasNext())
+ while (messagesEltIterator.hasNext())
{
- Element msgElt = (Element)messagesEltIterator.next();
+ Element msgElt = (Element) messagesEltIterator.next();
String name = msgElt.getAttribute("name");
@@ -162,15 +190,16 @@
//create value from the tag content
NodeList nodes = msgElt.getChildNodes();
- for (int i = 0; i < nodes.getLength(); i++) {
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
Node n = nodes.item(i);
- if (n.getNodeType() == Element.TEXT_NODE) {
+ if (n.getNodeType() == Element.TEXT_NODE)
+ {
value.append(n.getNodeValue());
}
}
-
Map entries;
if (!messages.containsKey(name))
{
@@ -179,7 +208,7 @@
}
else
{
- entries = (Map)messages.get(name);
+ entries = (Map) messages.get(name);
}
entries.put(locale, value.toString());
@@ -189,16 +218,15 @@
//Reiterate whole bundle to store LocalizedString values;
for (Iterator iterator = messages.keySet().iterator(); iterator.hasNext();)
{
- String name = (String)iterator.next();
- Map entries = (Map)messages.get(name);
+ String name = (String) iterator.next();
+ Map entries = (Map) messages.get(name);
- messagesBundle.put(name, new LocalizedString(entries, Locale.ENGLISH));
+ messagesBundle.put(name, new LocalizedString(entries, Locale.ENGLISH));
}
-
}
else
{
- throw new Exception(); // Basic for now
+ throw new WidgetMetaDataParseException("Could not parse widget meta data.");
}
//
@@ -206,7 +234,7 @@
Iterator userPrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "UserPref");
while (userPrefsEltIterator.hasNext())
{
- Element userPref = (Element)userPrefsEltIterator.next();
+ Element userPref = (Element) userPrefsEltIterator.next();
String nameAttr = userPref.getAttribute("name");
String displayNameAttr = userPref.getAttribute("display_name");
String urlParamAttr = userPref.getAttribute("urlparam");
@@ -217,7 +245,7 @@
// We don't support that for now
if (urlParamAttr.length() > 0)
{
- throw new Exception("We don't support the attibute ("+ urlParamAttr + ") for now.");
+ throw new WidgetNotSupportedException("urlparam not supported yet.");
}
// String is default type when not specified
@@ -225,50 +253,45 @@
if (dataTypeAttr.length() > 0)
{
int dataTypeOrdinal = DataType.parseDataTypeLiteral(dataTypeAttr);
- switch(dataTypeOrdinal)
+ switch (dataTypeOrdinal)
{
- case DataType.HIDDEN:
+ case DataType.HIDDEN :
dataType = HiddenType.getInstance();
break;
- case DataType.BOOL:
+ case DataType.BOOL :
dataType = BoolType.getInstance();
break;
- case DataType.STRING:
+ case DataType.STRING :
dataType = StringType.getInstance();
break;
- case DataType.LIST:
+ case DataType.LIST :
dataType = ListType.getInstance();
break;
- case DataType.ENUM:
+ case DataType.ENUM :
Collection values = new ArrayList();
- for (Iterator i = XMLTools.getChildrenIterator(userPref, "EnumValue");i.hasNext();)
+ for (Iterator i = XMLTools.getChildrenIterator(userPref, "EnumValue"); i.hasNext();)
{
- Element enumValueElt = (Element)i.next();
+ Element enumValueElt = (Element) i.next();
String valueAttr = enumValueElt.getAttribute("value");
String displayValueAttr = enumValueElt.getAttribute("display_value");
- EnumType.Value value = new EnumType.Value(valueAttr, resolveLocalizedValue(displayValueAttr, messagesBundle));
+ EnumType.Value value = new EnumType.Value(valueAttr, resolveLocalizedValue(displayValueAttr,
+ messagesBundle));
values.add(value);
}
dataType = new EnumType(values);
break;
- case DataType.LOCATION:
+ case DataType.LOCATION :
dataType = LocationType.getInstance();
break;
}
}
//
+ GGPreferenceInfo prefInfo = new GGPreferenceInfo(nameAttr, dataType, resolveLocalizedValue(displayNameAttr,
+ messagesBundle), requiredAttr.length() > 0 ? Boolean.valueOf(requiredAttr).booleanValue() : false,
+ defaultValueAttr.length() > 0 ? defaultValueAttr : null);
-
- GGPreferenceInfo prefInfo = new GGPreferenceInfo(
- nameAttr,
- dataType,
- resolveLocalizedValue(displayNameAttr, messagesBundle),
- requiredAttr.length() > 0 ? Boolean.valueOf(requiredAttr).booleanValue() : false,
- defaultValueAttr.length() > 0 ? defaultValueAttr : null
- );
-
//
if (tmp == null)
{
@@ -285,7 +308,7 @@
modulePrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "ModulePrefs");
if (modulePrefsEltIterator.hasNext())
{
- Element modulePrefsElt = (Element)modulePrefsEltIterator.next();
+ Element modulePrefsElt = (Element) modulePrefsEltIterator.next();
String titleAttr = modulePrefsElt.getAttribute("title");
String directoryTitleAttr = modulePrefsElt.getAttribute("directory_title");
String descriptionAttr = modulePrefsElt.getAttribute("description");
@@ -297,21 +320,21 @@
LocalizedString directoryTitle = resolveLocalizedStringValue(directoryTitleAttr, messagesBundle);
LocalizedString description = resolveLocalizedStringValue(descriptionAttr, messagesBundle);
-
int width = (widthAttr != null && widthAttr.length() > 0) ? Integer.parseInt(widthAttr) : 320;
int height = (heightAttr != null && heightAttr.length() > 0) ? Integer.parseInt(heightAttr) : 200;
- System.out.println("fetchting & building gadget: " + url.toString() + " took: " + NumberFormat.getInstance().format((System.currentTimeMillis() - millis) / 1000.0));
+ System.out.println("fetchting & building gadget: " + url.toString() + " took: "
+ + NumberFormat.getInstance().format((System.currentTimeMillis() - millis) / 1000.0));
return new GGWidgetInfo(title, directoryTitle, description, width, height, prefsInfo);
}
else
{
- throw new Exception(); // Basic for now
+ throw new WidgetMetaDataParseException("Could parse widget meta data.");
}
}
private LocalizedString resolveLocalizedStringValue(String value, Map bundle)
{
- if(value != null)
+ if (value != null)
{
if (value.startsWith("__MSG_"))
{
@@ -319,13 +342,12 @@
if (bundle.containsKey(name))
{
- return (LocalizedString)bundle.get(name);
+ return (LocalizedString) bundle.get(name);
}
}
return new LocalizedString(value, Locale.ENGLISH);
}
-
return null;
}
@@ -338,17 +360,13 @@
{
return out.getDefaultString();
}
-
return null;
-
}
-
-
/**
* needed for testing
*/
- protected byte[] obtainWidget(URL url) throws Exception
+ protected byte[] obtainWidget(URL url) throws IllegalArgumentException
{
return obtainURL(url);
}
@@ -356,12 +374,12 @@
/**
* needed for testing
*/
- protected byte[] obtainLocaleBundle(URL url) throws Exception
+ protected byte[] obtainLocaleBundle(URL url) throws IllegalArgumentException
{
return obtainURL(url);
}
- private byte[] obtainURL(URL url) throws Exception
+ private byte[] obtainURL(URL url) throws IllegalArgumentException
{
return URLTools.getContent(url, 5000, 5000);
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetMapEntry.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetMapEntry.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetMapEntry.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -46,25 +46,10 @@
public Widget call() throws Exception
{
GGWidgetInfoBuilder builder = new GGWidgetInfoBuilder(url);
- try
- {
- GGWidgetInfo info = builder.create();
- if (info != null)
- {
- // expires
- return new GGWidget(url, info);
- }
- else
- {
- // expires
- return null;
- }
- }
- catch (Exception e)
- {
- // logging && expiration
- return null;
- }
+ GGWidgetInfo info = builder.create();
+
+ //
+ return new GGWidget(url, info);
}
}
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/NetvibesWidget.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -49,7 +49,7 @@
private final String id;
/** The default widget height */
- private final static String defaultHeight = "200";
+ private final static String defaultHeight = "215";
/** The netvibes widget info */
private final NetvibesWidgetInfo widgetInfo;
@@ -123,7 +123,7 @@
}
}
- String actualHeight = tempHeight != null ? tempHeight : defaultHeight;
+ String actualHeight = tempHeight != null ? String.valueOf(Integer.valueOf(tempHeight).intValue() + 15) : 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/provider/NetvibesJSONInfoBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesJSONInfoBuilder.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesJSONInfoBuilder.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -25,11 +25,16 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.widget.exceptions.WidgetException;
+import org.jboss.portal.widget.exceptions.WidgetFetchException;
+import org.jboss.portal.widget.exceptions.WidgetMetaDataParseException;
+import org.jboss.portal.widget.exceptions.WidgetNotSupportedException;
import org.jboss.portal.widget.netvibes.NetvibesMetaData;
import org.jboss.portal.widget.netvibes.NetvibesPreferenceInfo;
import org.jboss.portal.widget.netvibes.NetvibesPreferencesInfo;
@@ -57,6 +62,9 @@
/** The URL */
private final URL url;
+ /** . */
+ private static final String COULD_NOT_PARSE = "/* String could not be parsed as XML */ null";
+
public NetvibesJSONInfoBuilder(URL url)
{
if ( url == null)
@@ -76,26 +84,31 @@
return new URL(jsonUrl.toString());
}
- public NetvibesWidgetInfo create()
+ public NetvibesWidgetInfo create() throws WidgetException
{
try
{
byte[] bytes = obtainWidget(this.url);
if(bytes == null)
{
- return null;
+ throw new WidgetFetchException("Could not retreive widget: "+ url.toString());
}
+ // If requested widget is not uwa conform it returns : String could not be parsed as XML
+ if ( Arrays.equals(bytes, COULD_NOT_PARSE.getBytes()) )
+ {
+ throw new WidgetMetaDataParseException("Could not parse widget meta data: "+ url.toString());
+ }
+
// Create JSONObject
JSONObject jsonResponse = new JSONObject(new String(bytes));
// Getting the title
LocalizedString title = new LocalizedString(jsonResponse.getString("title"));
- if(title == null)
+ if (title == null)
{
- // log unsupported format
- return null;
+ throw new WidgetMetaDataParseException("Unsupported widget format: "+ url.toString());
}
// Getting the icons
@@ -132,6 +145,13 @@
metadata.getBoolean("inline")
);
+ // Checking UWA compatible version
+ int version = metadata.getInt("apiVersion");
+ if (version < 1)
+ {
+ throw new WidgetNotSupportedException("Not supported widget version.");
+ }
+
// Netvibes preferences
List<NetvibesPreferenceInfo> preferences = new ArrayList<NetvibesPreferenceInfo>();
JSONArray array = jsonResponse.getJSONArray("preferences");
@@ -199,13 +219,11 @@
}
catch(JSONException e)
{
- // log.error("Can not parse widget information: "+ url, e);
- return null;
+ throw new WidgetMetaDataParseException("Could not parse widget meta data: "+ url.toString(), e);
}
- catch(Exception e)
+ catch(MalformedURLException e)
{
- // log.error("Can not obtain widget information: "+ url, e);
- return null;
+ throw new WidgetFetchException("Unable to build url.", e);
}
}
@@ -228,16 +246,20 @@
/**
* needed for testing
+ * @throws MalformedURLException
+ * @throws IllegalArgumentException
*/
- protected byte[] obtainWidget(URL url) throws Exception
+ protected byte[] obtainWidget(URL url) throws IllegalArgumentException, MalformedURLException
{
return obtainURL(url);
}
/**
* creating correct url here to be able to also get local sources for testing
+ * @throws MalformedURLException
+ * @throws IllegalArgumentException
*/
- private byte[] obtainURL(URL url) throws Exception
+ private byte[] obtainURL(URL url) throws IllegalArgumentException, MalformedURLException
{
return URLTools.getContent(this.buildNetvibesJSONUrl(url), 5000, 5000);
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResult.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResult.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResult.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -61,6 +61,11 @@
{
return entries.iterator();
}
+
+ public int resultSize()
+ {
+ return entries.size();
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResultBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResultBuilder.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesQueryResultBuilder.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -23,20 +23,22 @@
package org.jboss.portal.widget.netvibes.provider;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.widget.WidgetQuery;
+import org.jboss.portal.widget.exceptions.WidgetException;
import org.jboss.portal.widget.netvibes.directory.NVEcosystemFactory;
import org.jboss.portal.widget.netvibes.directory.NVQueryResultMetaData;
+import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -48,6 +50,7 @@
public class NetvibesQueryResultBuilder
{
+ /** . */
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(NetvibesQueryResultBuilder.class);
/** . */
@@ -58,7 +61,7 @@
{
if (query == null)
{
-
+ throw new IllegalArgumentException("query must not be null.");
}
this.url = query.buildQueryURL();
}
@@ -67,17 +70,16 @@
{
if (url == null)
{
-
+ throw new IllegalArgumentException("url must not be null.");
}
this.url = url;
}
- public NetvibesQueryResult build(int connectionTimeout)
+ public NetvibesQueryResult build(int connectionTimeout) throws WidgetException
{
try
{
// Read fully the URL content first
- long millis = System.currentTimeMillis();
byte[] bytes;
if ("http".equals(url.getProtocol()))
{
@@ -100,7 +102,7 @@
//
if (bytes == null)
{
- throw new Exception("Cannot retrieve " + url);
+ throw new WidgetException("Cannot retrieve url: " + url);
}
String string = new String(bytes);
@@ -126,14 +128,16 @@
}
catch (SocketTimeoutException e)
{
- log.error("Query for netvibs widget in directory failed due to timeout. Try to increase connectionTimeout initial parameter; ", e);
+ throw new WidgetException("Netvibes directory query failed due to timeout. Try to increase connectionTimeout initial parameter; ", e);
}
- catch(Exception e)
+ catch(JBossXBException e)
{
- log.error("Netvibes widget query failed: ", e);
+ throw new WidgetException("Failed to parse directory response.", e);
}
- return new NetvibesQueryResult(Collections.EMPTY_LIST);
- }
-
+ catch(IOException e)
+ {
+ throw new WidgetException("Failed to perform directory lookup.", e);
+ }
+ }
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesWidgetMapEntry.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesWidgetMapEntry.java 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/netvibes/provider/NetvibesWidgetMapEntry.java 2007-11-20 13:49:23 UTC (rev 9034)
@@ -47,14 +47,9 @@
{
NetvibesJSONInfoBuilder builder = new NetvibesJSONInfoBuilder(url);
NetvibesWidgetInfo info = builder.create();
- if ( info != null )
- {
- return new NetvibesWidget(url, info);
- }
- else
- {
- return null;
- }
+
+ //
+ return new NetvibesWidget(url, info);
}
}
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp 2007-11-20 13:49:23 UTC (rev 9034)
@@ -15,59 +15,66 @@
<%@ page language="java" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>
<%@ page isELIgnored="false" %>
+<%@page import="org.jboss.portal.widget.Widget"%>
+<%@page import="org.jboss.portal.widget.exceptions.WidgetFailure"%>
+<%@page import="org.jboss.portal.widget.netvibes.NetvibesWidgetInfo"%>
+<%@page import="org.jboss.portal.widget.DirectoryQueryResult"%>
+<%@page import="org.jboss.portal.widget.netvibes.provider.NetvibesQueryResult"%>
+<%@page import="org.jboss.portal.widget.exceptions.DirectoryResultFailure"%>
<p:defineObjects/>
<div>
<%
NetvibesProvider provider = (NetvibesProvider)request.getAttribute("provider");
- NetvibesWidget selWidget = null;
+ Widget selWidget = null;
String uri = request.getParameter("content.uri");
if (uri != null)
{
- selWidget = (NetvibesWidget) provider.getWidget(uri);
+ selWidget = provider.getWidget(uri);
}
- // Number of results to display
- int numberOfResults = 10;
- String resultSize= request.getParameter("numberOfResults");
- if (resultSize != null && !resultSize.equals(""))
- {
- numberOfResults = Integer.parseInt(resultSize);
- }
+ // Number of results to display
+ int numberOfResults = 10;
+ String resultSize= request.getParameter("numberOfResults");
+ if (resultSize != null && !resultSize.equals(""))
+ {
+ numberOfResults = Integer.parseInt(resultSize);
+ }
- // Pagination
- int currentPage = 0;
- String tempPage = request.getParameter("currentPage");
- if ( tempPage != null && !tempPage.equals(""))
- {
- int temp = Integer.parseInt(tempPage);
- currentPage = temp < 0 ? 0 : temp;
- }
+ //
+ int currentPage = 0;
+ String tempPage = request.getParameter("currentPage");
+ if ( tempPage != null && !tempPage.equals(""))
+ {
+ int temp = Integer.parseInt(tempPage);
+ currentPage = temp < 0 ? 0 : temp;
+ }
- // Get query term
- String queryTerm = request.getParameter("query");
- if (queryTerm == null)
- {
- queryTerm = "";
- }
-
- String type = request.getParameter("type");
- if (type == null)
- {
- type = "all";
- }
+ // Get query term
+ String queryTerm = request.getParameter("query");
+ if (queryTerm == null)
+ {
+ queryTerm = "";
+ }
+
+ // Type
+ String type = request.getParameter("type");
+ if (type == null)
+ {
+ type = "all";
+ }
- // Get category term
- String catTerm = request.getParameter("cat");
- if (catTerm == null)
- {
- catTerm = "0"; // all
- }
+ // Get category term
+ String catTerm = request.getParameter("cat");
+ if (catTerm == null)
+ {
+ catTerm = "0"; // all
+ }
- // Compute query
- int queryStart = currentPage * numberOfResults;
- NetvibesQuery query = new NetvibesQuery(queryStart, numberOfResults + 1, catTerm, type, queryTerm);
- List queryResults = provider.search(query);
+ // Compute query
+ int queryStart = currentPage * numberOfResults;
+ NetvibesQuery query = new NetvibesQuery(queryStart, numberOfResults + 1, catTerm, type, queryTerm);
+ DirectoryQueryResult queryResults = provider.search(query);
boolean uriPickMethod = false;
String nvPickMethod = request.getParameter("nv_pick_method");
@@ -96,13 +103,12 @@
%>
<form action="<%= contentURL %>" method="post">
<%
- if (uri != null && selWidget == null)
+ if (uri != null && selWidget instanceof WidgetFailure)
{
+ WidgetFailure failure = (WidgetFailure) selWidget;
%>
<p style="color: red;">
- <%
- out.println("Failed to obtain widget with URI: " + uri);
- %>
+ <%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
}
@@ -165,11 +171,42 @@
<br/>
<input type="submit" value="Search Widgets" class="portlet-form-button"/>
</form>
-
+ <%
+ if (uri != null && selWidget instanceof WidgetFailure)
+ {
+ WidgetFailure failure = (WidgetFailure) selWidget;
+ %>
+ <p style="color: red;">
+ <%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
+ </p>
+ <%
+ }
+ else if (selWidget != null)
+ {
+ %>
+ <p style="color: blue;">
+ Selected Widget:
+ <%= selWidget.getTitle().getDefaultString() %>
+ </p>
+ <%
+ }
+ %>
+
+ <% // If widget directory lookup was successful
+ if ( queryResults == null || queryResults instanceof DirectoryResultFailure )
+ {
+ DirectoryResultFailure resultFailure = (DirectoryResultFailure) queryResults;
+ %>
+ <p style="color: red;"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
+ <%
+ }
+ else
+ {
+ %>
<p>
<table style="width:100%; border: 1px solid;" cellspacing="0" cellpadding="0">
<%
- for (IteratorStatus i = new IteratorStatus(queryResults.iterator()); i.hasNext();)
+ for (IteratorStatus i = new IteratorStatus(queryResults.entries()); i.hasNext();)
{
if ( (i.getIndex() + 1) >= numberOfResults)
{
@@ -177,7 +214,15 @@
}
DirectoryQueryResultEntry result = (DirectoryQueryResultEntry) i.next();
- boolean selected = selWidget != null && selWidget.getId().equals(result.getURL().toString());
+ boolean selected = false;
+ if ( selWidget != null
+ && selWidget instanceof NetvibesWidget
+ && selWidget.getId().equals(result.getURL().toString())
+ )
+ {
+ selected = true;
+ }
+
PortletURL selectURL = renderResponse.createActionURL();
// Set parameters for selection
@@ -195,11 +240,14 @@
//
String rowClass = selected ? "portlet-section-selected" : (i.getIndex() % 2 == 0 ? "portlet-section-body" : "portlet-section-alternate");
+
%>
<tr class="<%= rowClass %>">
- <td><a
+ <td>
+ <a
href="<%= selectURL %>"><%= result.getTitle() %>
- </a></td>
+ </a>
+ </td>
</tr>
<%
}
@@ -226,7 +274,7 @@
</td>
<td style="text-align: right;">
<% // next page
- if ( queryResults.size() > numberOfResults )
+ if ( queryResults.resultSize() > numberOfResults )
{
PortletURL nextURL = renderResponse.createRenderURL();
nextURL.setParameter("cat", catTerm);
@@ -244,29 +292,34 @@
</tr>
</table>
</p>
+ <%
+ } // instanceof NetvibesQueryResult
+ %>
</div>
-
<%
- if (selWidget != null && !selWidget.getWidgetInfo().getPreferencesInfo().getPreferences().isEmpty())
+ if (selWidget != null
+ && selWidget instanceof NetvibesWidget )
{
-
- PortletURL selectURL = renderResponse.createActionURL();
+ NetvibesWidgetInfo widgetInfo = ((NetvibesWidget) selWidget).getWidgetInfo();
- // Set parameters for selection
- selectURL.setParameter("content.action.select", "content.action.select");
- selectURL.setParameter("content.uri", selWidget.getId());
+ if (! widgetInfo.getPreferencesInfo().getPreferences().isEmpty() )
+ {
+ PortletURL selectURL = renderResponse.createActionURL();
+ // Set parameters for selection
+ selectURL.setParameter("content.action.select", "content.action.select");
+ selectURL.setParameter("content.uri", selWidget.getId());
%>
<div>
<p>
<form action="<%= selectURL %>" method="post"><%
- for(Iterator i = selWidget.getWidgetInfo().getPreferencesInfo().getPreferences().iterator(); i.hasNext(); )
+ for(Iterator i = widgetInfo.getPreferencesInfo().getPreferences().iterator(); i.hasNext(); )
{
// hidden preferences
- NetvibesPreferenceInfo prefInfo = (NetvibesPreferenceInfo) selWidget.getWidgetInfo().getPreferencesInfo().getPreference((String) i.next());
+ NetvibesPreferenceInfo prefInfo = (NetvibesPreferenceInfo) widgetInfo.getPreferencesInfo().getPreference((String) i.next());
if ( NVDataType.HIDDEN == prefInfo.getType().getOrdinal())
{
%><input type="hidden" name="content.param.<%= prefInfo.getName() %>"
@@ -275,10 +328,10 @@
}
%>
<table><%
- for(Iterator i = selWidget.getWidgetInfo().getPreferencesInfo().getPreferences().iterator(); i.hasNext(); )
+ for(Iterator i = widgetInfo.getPreferencesInfo().getPreferences().iterator(); i.hasNext(); )
{
String key = (String) i.next();
- NetvibesPreferenceInfo prefInfo = (NetvibesPreferenceInfo) selWidget.getWidgetInfo().getPreferencesInfo().getPreference(key);
+ NetvibesPreferenceInfo prefInfo = (NetvibesPreferenceInfo) widgetInfo.getPreferencesInfo().getPreference(key);
int prefDataType = prefInfo.getType().getOrdinal();
// If preference is not hidden
@@ -347,5 +400,7 @@
</form>
</p>
</div><%
+ }
}
-%></div>
\ No newline at end of file
+%>
+</div>
\ No newline at end of file
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2007-11-20 13:49:23 UTC (rev 9034)
@@ -42,6 +42,11 @@
<name>entryExpiration</name>
<value>1440</value>
</init-param>
+ <init-param>
+ <description>Time until a query expires. Default value is 15 minutes.</description>
+ <name>queryExpiration</name>
+ <value>15</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2007-11-20 13:49:23 UTC (rev 9034)
@@ -17,6 +17,11 @@
<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>
<%@ page isELIgnored="false" %>
+<%@page import="org.jboss.portal.widget.Widget"%>
+<%@page import="org.jboss.portal.widget.exceptions.WidgetFailure"%>
+<%@page import="org.jboss.portal.widget.google.info.GGWidgetInfo"%>
+<%@page import="org.jboss.portal.widget.DirectoryQueryResult"%>
+<%@page import="org.jboss.portal.widget.exceptions.DirectoryResultFailure"%>
<p:defineObjects/>
<div>
@@ -25,14 +30,13 @@
GGProvider provider = (GGProvider)request.getAttribute("provider");
// Get the selected widget if any
- GGWidget selWidget = null;
+ Widget selWidget = null;
String uri = request.getParameter("content.uri");
if (uri != null)
{
- selWidget = (GGWidget) provider.getWidget(uri);
+ selWidget = provider.getWidget(uri);
}
-
// Number of results to display
int numberOfResults = 10;
String resultSize= request.getParameter("numberOfResults");
@@ -50,7 +54,6 @@
currentPage = temp < 0 ? 0 : temp;
}
-
// Get query term
String queryTerm = request.getParameter("query");
if (queryTerm == null)
@@ -68,7 +71,7 @@
// Compute query
int queryStart = currentPage * numberOfResults;
GGQuery query = new GGQuery(queryStart, numberOfResults + 1, catTerm, queryTerm, request.getLocale());
- List queryResults = provider.search(query);
+ DirectoryQueryResult queryResults = provider.search(query);
String ggPickMethod = request.getParameter("gg_pick_method");
boolean uriPickMethod = false;
@@ -100,22 +103,22 @@
<form action="<%= contentURL %>" method="post">
<%
- if (uri != null && selWidget == null)
+ if (uri != null && selWidget instanceof WidgetFailure)
{
+ WidgetFailure failure = (WidgetFailure) selWidget;
%>
<p style="color: red;">
- <%
- out.println("Failed to obtain widget with URI: " + uri);
- %>
+ <%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
</p>
<%
}
else if (selWidget != null)
{
+ GGWidget widget = (GGWidget) selWidget;
%>
<p style="color: blue;">
Selected
- Widget: <%=selWidget.getDirectoryTitle().getDefaultString().length() > 0 ? selWidget.getDirectoryTitle().getDefaultString() : selWidget.getTitle().getDefaultString()%>
+ Widget: <%= widget.getDirectoryTitle().getDefaultString().length() > 0 ? widget.getDirectoryTitle().getDefaultString() : widget.getTitle().getDefaultString()%>
</p>
<%
}
@@ -157,12 +160,44 @@
</select>
<br/>
<input type="submit" value="Search Gadgets" class="portlet-form-button"/>
+ <%
+ if (uri != null && selWidget instanceof WidgetFailure)
+ {
+ WidgetFailure failure = (WidgetFailure) selWidget;
+ %>
+ <p style="color: red;">
+ <%= failure.getLocalizedErrorMessage( request.getLocale() ) %>
+ </p>
+ <%
+ }
+ else if (selWidget != null)
+ {
+ GGWidget widget = (GGWidget) selWidget;
+ %>
+ <p style="color: blue;">
+ Selected
+ Widget: <%= widget.getDirectoryTitle().getDefaultString().length() > 0 ? widget.getDirectoryTitle().getDefaultString() : widget.getTitle().getDefaultString()%>
+ </p>
+ <%
+ }
+ %>
</form>
+ <% // If widget directory lookup was successful
+ if ( queryResults == null || queryResults instanceof DirectoryResultFailure )
+ {
+ DirectoryResultFailure resultFailure = (DirectoryResultFailure) queryResults;
+ %>
+ <p style="color: red;"><%= resultFailure.getLocalizedErrorMessage( request.getLocale() ) %></p>
+ <%
+ }
+ else
+ {
+ %>
<p>
<table style="width:100%; border: 1px solid;" cellspacing="0" cellpadding="0">
<%
- for (IteratorStatus i = new IteratorStatus(queryResults.iterator()); i.hasNext();)
+ for (IteratorStatus i = new IteratorStatus(queryResults.entries()); i.hasNext();)
{
if ( (i.getIndex() + 1) >= numberOfResults)
{
@@ -170,7 +205,14 @@
}
DirectoryQueryResultEntry result = (DirectoryQueryResultEntry) i.next();
- boolean selected = selWidget != null && selWidget.getId().equals(result.getURL().toString());
+ boolean selected = false;
+ if ( selWidget != null
+ && selWidget instanceof GGWidget
+ && selWidget.getId().equals(result.getURL().toString())
+ )
+ {
+ selected = true;
+ }
PortletURL selectURL = renderResponse.createActionURL();
// Set parameters for selection
@@ -217,7 +259,7 @@
</td>
<td style="text-align: right;">
<% // next page
- if ( queryResults.size() > numberOfResults )
+ if ( queryResults.resultSize() > numberOfResults )
{
PortletURL nextURL = renderResponse.createRenderURL();
nextURL.setParameter("cat", catTerm);
@@ -234,12 +276,20 @@
</tr>
</table>
</p>
+ <%
+ } // instanceof GGQueryResult
+ %>
+
</div>
<div>
<%
- if (selWidget != null && !selWidget.getInfo().getPreferences().getPreferences().isEmpty())
- {
+ if (selWidget != null && selWidget instanceof GGWidget)
+ {
+ GGWidgetInfo widgetInfo = ((GGWidget) selWidget).getInfo();
+
+ if (! widgetInfo.getPreferences().getPreferences().isEmpty())
+ {
PortletURL selectURL = renderResponse.createActionURL();
// Set parameters for selection
@@ -262,7 +312,7 @@
<form action="<%= selectURL %>" method="post">
<%
- for (Iterator i = selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
+ for (Iterator i = widgetInfo.getPreferences().getPreferences().iterator(); i.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
if (prefInfo.getType().getOrdinal() == DataType.HIDDEN)
@@ -278,7 +328,7 @@
<table>
<tbody>
<%
- for (Iterator i = selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
+ for (Iterator i = widgetInfo.getPreferences().getPreferences().iterator(); i.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
@@ -344,6 +394,7 @@
</form>
</p>
<%
+ }
}
%>
</div>
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-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-11-20 13:49:23 UTC (rev 9034)
@@ -45,7 +45,7 @@
<init-param>
<description>Time until a query expires. Default value is 15 minutes.</description>
<name>queryExpiration</name>
- <value>900</value>
+ <value>15</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response8
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response8 2007-11-20 01:34:26 UTC (rev 9033)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/netvibes/json.response8 2007-11-20 13:49:23 UTC (rev 9034)
@@ -1 +1,10 @@
-{"title":"Astronomy Picture of the Day","icon":{"0":"http:\/\/antwrp.gsfc.nasa.gov\/apod\/favicon.ico"},"metas":{"author":"Louis-Xavier Vignal (Netvibes)","description":"Each day a different image or photograph of our fascinating universe.","keywords":"astronomy, picture, science, spatial","inline":"true","apiVersion":"1.0","debugMode":"false"},"preferences":[]}
\ No newline at end of file
+{"title":"Astronomy Picture of the Day",
+"icon":{"0":"http:\/\/antwrp.gsfc.nasa.gov\/apod\/favicon.ico"},
+"metas":{
+"author":"Louis-Xavier Vignal (Netvibes)",
+"description":"Each day a different image or photograph of our fascinating universe.",
+"keywords":"astronomy, picture, science, spatial",
+"inline":"true",
+"apiVersion":"1.0",
+"debugMode":"false"},
+"preferences":[]}
\ No newline at end of file
16 years, 7 months
JBoss Portal SVN: r9033 - in branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war: WEB-INF/jsf/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-19 20:34:26 -0500 (Mon, 19 Nov 2007)
New Revision: 9033
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1567:
+ Improved layout.
+ Added description column for registration properties (it used to be only in the row title).
+ Registration properties table is now bordered for better structuring of the page.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-20 00:14:29 UTC (rev 9032)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-20 01:34:26 UTC (rev 9033)
@@ -79,24 +79,24 @@
</tr>
<c:if test="#{consumer.localInfoPresent}">
<tr>
- <th>Registration information</th>
+ <th>Registration information:</th>
<td>
<c:choose>
<c:when test="#{consumer.localInfoPresent}">
<c:choose>
<c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationProperties}">
- <table border='1' cellspacing='0' class='registration-prop-table'>
+ <table class="registration-prop-table #{consumer.active ? 'active' : 'inactive'}">
<tr>
- <th>Name</th>
+ <th class="nameColumn">Name</th>
+ <th class="descColumn">Description</th>
<th>Value</th>
</tr>
<c:forEach items="#{consumer.producerInfo.registrationInfo.registrationProperties}" var="prop">
<tr title="#{prop.description.label.value}">
+ <td>#{prop.name}</td>
+ <td>#{prop.description.label.value}</td>
<td>
- <h:outputText value="#{prop.name}"/>
- </td>
- <td>
- <h:inputText value="#{prop.value}" size="40" onchange="this.form.submit()"
+ <h:inputText value="#{prop.value}" size="50" onchange="this.form.submit()"
immediate="true" valueChangeListener="#{consumer.regPropListener}"/>
<h:outputText styleClass="portlet-msg-error" value="#{prop.status}"
rendered="#{prop.determinedInvalid}"/>
@@ -119,7 +119,7 @@
<c:if test="#{!empty consumer.producerInfo.registrationInfo.registrationHandle}">
<tr>
<th>Registration context:</th>
- <td>
+ <td id="handle">
Handle: <h:outputText value="#{consumer.producerInfo.registrationInfo.registrationHandle}"/>
<h:commandLink action="#{consumer.eraseLocalRegistration}" value="Erase local registration"
title="Erase local registration information (potentially dangerous!)"
@@ -138,7 +138,8 @@
</c:if>
</c:if>
<tr>
- <td colspan="2" style="padding: 1em 1em 1em 0;">
+ <th/>
+ <td class="portlet-section-buttonrow">
<h:commandButton action="#{consumer.refreshConsumer}" value="Refresh & Save"
title="Save changes and refresh information from Producer"
styleClass="portlet-form-button"/>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-11-20 00:14:29 UTC (rev 9032)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-11-20 01:34:26 UTC (rev 9033)
@@ -178,6 +178,7 @@
border: 0;
padding-bottom: 2px;
padding-top: 2px;
+ vertical-align: top;
}
.wsrp-consumers-ui th {
@@ -246,10 +247,44 @@
.wsrp-consumers-ui .registration-prop-table {
text-align: left;
- border: 0;
- border-collapse: separate;
+ width: 100%;
}
+.wsrp-consumers-ui .registration-prop-table.active {
+ border: 1px solid #C7DDB7;
+}
+
+.wsrp-consumers-ui .registration-prop-table.active th {
+ background-color: #C7DDB7;
+}
+
+.wsrp-consumers-ui .registration-prop-table.inactive {
+ border: 1px solid #EBD1B8;
+}
+
+.wsrp-consumers-ui .registration-prop-table.inactive th {
+ background-color: #EBD1B8;
+}
+
+.wsrp-consumers-ui .registration-prop-table th.nameColumn {
+ width: 25%;
+}
+
+.wsrp-consumers-ui .registration-prop-table th.descColumn {
+ width: 25%;
+}
+
+.wsrp-consumers-ui .portlet-section-buttonrow {
+ margin-top: 6px;
+ margin-bottom: 6px;
+ float: right;
+}
+
+.wsrp-consumers-ui #handle a.portlet-form-button {
+ padding: .2em;
+ margin-left: 3em;
+}
+
.wsrp-consumers-ui .portlet-form-button {
padding: .2em;
margin: 0 .3em;
@@ -281,7 +316,7 @@
.wsrp-consumers-ui .portlet-area-body {
border: 1px solid #d5d5d5;
- border-top: 0px;
+ border-top: 0;
background-color: #fff;
padding: 4px;
margin: 0;
16 years, 7 months
JBoss Portal SVN: r9032 - in branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server: servlet and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-11-19 19:14:29 -0500 (Mon, 19 Nov 2007)
New Revision: 9032
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/servlet/PortalServlet.java
Log:
make 2.6 delegate parameter parsing to WebRequest from web module
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-20 00:12:45 UTC (rev 9031)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-11-20 00:14:29 UTC (rev 9032)
@@ -35,6 +35,8 @@
import org.jboss.portal.server.ServerURL;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -54,6 +56,9 @@
/** The client request. */
private final HttpServletRequest req;
+ /** The client request. */
+ private final WebRequest webReq;
+
/** The client response. */
private final HttpServletResponse resp;
@@ -66,15 +71,6 @@
/** The portal host. */
private String portalHost;
- /** . */
- private String mediaType;
-
- /** The query parameter map. */
- private ParameterMap queryParameterMap;
-
- /** The body parameter map or null. */
- private ParameterMap bodyParameterMap;
-
/** The url context. */
private URLContext urlContext;
@@ -90,13 +86,11 @@
public ServerInvocationContextImpl(
HttpServletRequest req,
HttpServletResponse resp,
+ WebRequest webReq,
String portalHost,
String portalRequestPath,
String portalContextPath,
- Map queryParameterMap,
- Map bodyParameterMap,
- URLContext urlContext,
- String mediaType)
+ URLContext urlContext)
{
if (req == null)
{
@@ -109,14 +103,12 @@
//
this.req = req;
+ this.webReq = webReq;
this.resp = resp;
this.portalRequestPath = portalRequestPath;
this.portalContextPath = portalContextPath;
this.portalHost = portalHost;
- this.queryParameterMap = new ParameterMap(queryParameterMap);
- this.bodyParameterMap = bodyParameterMap != null ? new ParameterMap(bodyParameterMap) : null;
this.urlContext = urlContext;
- this.mediaType = mediaType;
this.buffers = new Buffer[16];
//
@@ -157,7 +149,7 @@
public String getMediaType()
{
- return mediaType;
+ return webReq.getMediaType();
}
public URLContext getURLContext()
@@ -167,12 +159,21 @@
public ParameterMap getQueryParameterMap()
{
- return queryParameterMap;
+ return webReq.getQueryParameterMap();
}
public ParameterMap getBodyParameterMap()
{
- return bodyParameterMap;
+ Body body = webReq.getBody();
+
+ //
+ if (body instanceof Body.Form)
+ {
+ return ((Body.Form)body).getParameters();
+ }
+
+ //
+ return null;
}
public String getPortalRequestPath()
Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java 2007-11-20 00:12:45 UTC (rev 9031)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/servlet/PortalServlet.java 2007-11-20 00:14:29 UTC (rev 9032)
@@ -25,12 +25,10 @@
import org.apache.log4j.Logger;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.common.http.QueryStringParser;
import org.jboss.portal.common.invocation.InterceptorStackFactory;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.common.util.Exceptions;
-import org.jboss.portal.server.PortalConstants;
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.RequestControllerDispatcher;
import org.jboss.portal.server.RequestControllerFactory;
@@ -42,6 +40,7 @@
import org.jboss.portal.server.ServerResponse;
import org.jboss.portal.server.impl.ServerInvocationContextImpl;
import org.jboss.portal.server.request.URLContext;
+import org.jboss.portal.web.WebRequest;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -51,11 +50,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
/**
* The main servlet of the portal. This servlet must be properly configured with the servlet mapping style it is
@@ -67,12 +61,6 @@
public class PortalServlet extends HttpServlet
{
- /** . */
- private static final int GET_METHOD = 0;
-
- /** . */
- private static final int POST_METHOD = 1;
-
/** Describes a default servlet mapping. */
private static final int DEFAULT_SERVLET_MAPPING = 0;
@@ -167,68 +155,8 @@
return controllerFactory;
}
- private String retrieveMediaType(String contentType)
- {
- String mediaType = contentType;
-
- //
- if (mediaType != null)
- {
- // Remove any parameters
- int index = mediaType.indexOf(';');
- if (index != -1)
- {
- mediaType = contentType.substring(0, index);
- }
-
- // Trim
- mediaType = mediaType.trim();
-
- // Media type matching is case insensitive, so we convert to lower case
- mediaType = mediaType.toLowerCase();
- }
- return mediaType;
- }
-
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
- int method;
- if ("GET".equals(req.getMethod()))
- {
- method = GET_METHOD;
- }
- else if ("POST".equals(req.getMethod()))
- {
- method = POST_METHOD;
- }
- else
- {
- throw new ServletException();
- }
-
- // Compute the media type in the content type
- String mediaType = retrieveMediaType(req.getContentType());
-
- // Only affect the charset encoding if the servlet container will decode the request
- if (method == POST_METHOD && PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED.equals(mediaType))
- {
- // Now we must ensure that we have either an equals or a trailing space after the media-type
- String characterEncoding = req.getCharacterEncoding();
- if (characterEncoding == null)
- {
- // Set out charset for the portal request
- req.setCharacterEncoding(PortalConstants.UTF_8.name());
- }
- else
- {
- Charset charset = Charset.forName(characterEncoding);
- if (!PortalConstants.UTF_8.equals(charset))
- {
- throw new ServletException("Unaccepted charset " + characterEncoding);
- }
- }
- }
-
//
String servletPath = req.getServletPath();
String requestURI = req.getRequestURI();
@@ -277,65 +205,9 @@
//
URLContext urlContext = URLContext.newInstance(req.isSecure(), req.getRemoteUser() != null);
- // ***************
- // ***************
- // ***************
- // ***************
-
- // Parse the query string to have the get parameters
- // The resulting map has its parameters decoded from the x-www-form-url encoding
- Map queryParameterMap = Collections.EMPTY_MAP;
- String queryString = req.getQueryString();
- if (queryString != null)
- {
- queryParameterMap = QueryStringParser.getInstance().parseQueryString(queryString);
- }
-
//
- Map bodyParameterMap = null;
- if (method == POST_METHOD && PortalConstants.APPLICATION_X_WWW_FORM_URLENCODED.equals(mediaType))
- {
- bodyParameterMap = Collections.EMPTY_MAP;
- for (Iterator i = req.getParameterMap().entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
+ WebRequest webReq = new WebRequest(req);
- // Get param name
- String paramName = (String)entry.getKey();
-
- // Values that are aggregated from the query string and the body
- String[] paramValues = (String[])entry.getValue();
-
- // Values decoded from the query string
- String[] queryValues = (String[])queryParameterMap.get(paramName);
- if (queryValues != null)
- {
- int bodyValuesLength = paramValues.length - queryValues.length;
- if (bodyValuesLength > 0)
- {
- String[] bodyValues = new String[bodyValuesLength];
- System.arraycopy(paramValues, queryValues.length, bodyValues, 0, bodyValuesLength);
- if (bodyParameterMap.isEmpty())
- {
- bodyParameterMap = new HashMap();
- }
- bodyParameterMap.put(paramName, bodyValues);
- }
- }
- else
- {
- if (bodyParameterMap.isEmpty())
- {
- bodyParameterMap = new HashMap();
- }
- bodyParameterMap.put(paramName, paramValues);
- }
- }
-
- // Make the map unmodifiable
- bodyParameterMap = bodyParameterMap.isEmpty() ? bodyParameterMap : Collections.unmodifiableMap(bodyParameterMap);
- }
-
// ***************
// ***************
// ***************
@@ -348,13 +220,11 @@
ServerInvocationContext invocationCtx = new ServerInvocationContextImpl(
req,
resp,
+ webReq,
portalHost,
portalRequestPath,
portalContextPath,
- queryParameterMap,
- bodyParameterMap,
- urlContext,
- mediaType);
+ urlContext);
//
ServerRequest request = new ServerRequest(invocationCtx);
16 years, 7 months
JBoss Portal SVN: r9031 - in branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core: model/portal and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 19:12:45 -0500 (Mon, 19 Nov 2007)
New Revision: 9031
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
Log:
Oups, fixing PortalObject API
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20 00:11:35 UTC (rev 9030)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20 00:12:45 UTC (rev 9031)
@@ -146,11 +146,24 @@
this.displayNames = displayNames;
}
+
public Map getDisplayNames()
{
return displayNames;
}
+ public void setDisplayName(LocalizedString displayName)
+ {
+ displayNames = new HashMap();
+ Map map = displayName.getValues();
+ Iterator it = map.values().iterator();
+ while (it.hasNext())
+ {
+ LocalizedString.Value value = (LocalizedString.Value)it.next();
+ displayNames.put(value.getLocale(), value.getString());
+ }
+ }
+
public LocalizedString getDisplayName()
{
return new LocalizedString(displayNames, Locale.ENGLISH);
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2007-11-20 00:11:35 UTC (rev 9030)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2007-11-20 00:12:45 UTC (rev 9031)
@@ -99,7 +99,7 @@
*
* @param the localized display name
*/
- void setDisplayNames(Map localizedString);
+ void setDisplayName(LocalizedString localizedString);
/**
* Returns the listener id or null if there is none.
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20 00:11:35 UTC (rev 9030)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20 00:12:45 UTC (rev 9031)
@@ -30,6 +30,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.xml.XMLTools;
@@ -59,7 +60,7 @@
private Map properties;
private Map children;
private SecurityConstraintsMetaData securityConstraints;
- private Map displayNames;
+ private LocalizedString displayName;
public PortalObjectMetaData()
{
@@ -107,14 +108,14 @@
this.children = children;
}
- public void setDisplayNames(Map displayNames)
+ public void setDisplayName(LocalizedString displayName)
{
- this.displayNames = displayNames;
+ this.displayName = displayName;
}
- public Map getDisplayNames()
+ public LocalizedString getDisplayName()
{
- return displayNames;
+ return displayName;
}
public SecurityConstraintsMetaData getSecurityConstraints()
@@ -178,7 +179,7 @@
object.setListener(listener);
// Configure display name
- object.setDisplayNames(displayNames);
+ object.setDisplayName(displayName);
// Configure security
SecurityConstraintsMetaData securityConstraints = getSecurityConstraints();
@@ -310,7 +311,7 @@
}
if (localizedStringValues.size() != 0)
{
- portalObjectMD.setDisplayNames(localizedStringValues);
+ portalObjectMD.setDisplayName(new LocalizedString(localizedStringValues, Locale.ENGLISH));
}
}
16 years, 7 months
JBoss Portal SVN: r9030 - modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-19 19:11:35 -0500 (Mon, 19 Nov 2007)
New Revision: 9030
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocalizedString.java
Log:
Adding getValues method
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocalizedString.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocalizedString.java 2007-11-19 23:57:36 UTC (rev 9029)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/i18n/LocalizedString.java 2007-11-20 00:11:35 UTC (rev 9030)
@@ -22,15 +22,15 @@
******************************************************************************/
package org.jboss.portal.common.i18n;
-import org.apache.log4j.Logger;
-import org.jboss.portal.common.util.ConversionException;
-
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.util.ConversionException;
+
/**
* An immutable locale sensitive object that returns strings.
*
@@ -264,6 +264,11 @@
}
}
+ public Map getValues()
+ {
+ return Collections.unmodifiableMap(values);
+ }
+
/**
* Return the default locale of this localized string.
*
16 years, 7 months
JBoss Portal SVN: r9029 - in branches/JBoss_Portal_Branch_2_6/core-wsrp/src: resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-19 18:57:36 -0500 (Mon, 19 Nov 2007)
New Revision: 9029
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- JBPORTAL-1566: Use commandButton instead of commandLink for default action.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-19 23:54:15 UTC (rev 9028)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-11-19 23:57:36 UTC (rev 9029)
@@ -318,7 +318,7 @@
}
}
- return manager.refreshConsumer();
+ return manager.refresh(consumer);
}
beanContext.createErrorMessage("Couldn't save Consumer!");
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-19 23:54:15 UTC (rev 9028)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-11-19 23:57:36 UTC (rev 9029)
@@ -255,6 +255,14 @@
}
}
+ String refresh(WSRPConsumer consumer)
+ {
+ internalRefresh(consumer);
+ selectedId = consumer.getProducerId();
+ setConsumerIdInSession(false);
+ return CONFIGURE_CONSUMER;
+ }
+
public String listConsumers()
{
setConsumerIdInSession(true);
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-19 23:54:15 UTC (rev 9028)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-11-19 23:57:36 UTC (rev 9029)
@@ -139,11 +139,9 @@
</c:if>
<tr>
<td colspan="2" style="padding: 1em 1em 1em 0;">
- <h:commandLink action="#{consumer.refreshConsumer}" value="Refresh & Save"
- title="Save changes and refresh information from Producer"
- styleClass="portlet-form-button">
- <f:param name="id" value="#{consumer.id}"/>
- </h:commandLink>
+ <h:commandButton action="#{consumer.refreshConsumer}" value="Refresh & Save"
+ title="Save changes and refresh information from Producer"
+ styleClass="portlet-form-button"/>
<h:commandLink action="#{consumersMgr.listConsumers}" value="Cancel" immediate="true"
styleClass="portlet-form-button"/>
</td>
16 years, 7 months