JBoss Portal SVN: r7695 - branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-07-09 14:13:38 -0400 (Mon, 09 Jul 2007)
New Revision: 7695
Modified:
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java
Log:
JBPORTAL-1559 - HibernateMembershipModuleImpl assignUsers method : wrong error message
Modified: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java 2007-07-09 17:58:47 UTC (rev 7694)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java 2007-07-09 18:13:38 UTC (rev 7695)
@@ -110,7 +110,7 @@
{
if (!(role instanceof HibernateRoleImpl))
{
- throw new IllegalArgumentException("Role is not a HibernateRoleImpl user");
+ throw new IllegalArgumentException("Role is not a HibernateRoleImpl role");
}
// We return an immutable set to avoid modifications
@@ -131,7 +131,7 @@
//throw new UnsupportedOperationException("Not yet implemented");
if (!(role instanceof HibernateRoleImpl))
{
- throw new IllegalArgumentException("Role is not a HibernateRoleImpl user");
+ throw new IllegalArgumentException("Role is not a HibernateRoleImpl role");
}
for (Iterator i = users.iterator(); i.hasNext();)
16 years, 11 months
JBoss Portal SVN: r7694 - branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-07-09 13:58:47 -0400 (Mon, 09 Jul 2007)
New Revision: 7694
Modified:
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java
Log:
JBPORTAL-1559 - HibernateMembershipModuleImpl assignUsers method : wrong error message
Modified: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java 2007-07-09 17:04:35 UTC (rev 7693)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/db/HibernateMembershipModuleImpl.java 2007-07-09 17:58:47 UTC (rev 7694)
@@ -110,7 +110,7 @@
{
if (!(role instanceof HibernateRoleImpl))
{
- throw new IllegalArgumentException("User is not a HibernateRoleImpl user");
+ throw new IllegalArgumentException("Role is not a HibernateRoleImpl user");
}
// We return an immutable set to avoid modifications
@@ -131,7 +131,7 @@
//throw new UnsupportedOperationException("Not yet implemented");
if (!(role instanceof HibernateRoleImpl))
{
- throw new IllegalArgumentException("User is not a HibernateRoleImpl user");
+ throw new IllegalArgumentException("Role is not a HibernateRoleImpl user");
}
for (Iterator i = users.iterator(); i.hasNext();)
@@ -144,7 +144,7 @@
}
else
{
- throw new IllegalArgumentException("Only HibernateUserImpl roles can be accepted");
+ throw new IllegalArgumentException("Only HibernateUserImpl users can be accepted");
}
}
16 years, 11 months
JBoss Portal SVN: r7693 - branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-07-09 13:04:35 -0400 (Mon, 09 Jul 2007)
New Revision: 7693
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
Log:
JBPORTAL-1552 - In AdminPortlet when configuring Google Widget preferences 'displayName' attribute should be displayed - not 'name'
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-07-09 08:32:55 UTC (rev 7692)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-07-09 17:04:35 UTC (rev 7693)
@@ -152,7 +152,7 @@
}
%>
<tr>
- <td><%= prefInfo.getName() %>:</td>
+ <td><%= prefInfo.getDisplayName() != null ? prefInfo.getDisplayName() : prefInfo.getName() %>:</td>
<%
switch (prefInfo.getType().getOrdinal())
{
16 years, 11 months
JBoss Portal SVN: r7692 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-07-09 04:32:55 -0400 (Mon, 09 Jul 2007)
New Revision: 7692
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPRewritingConstants.java
Log:
Javadoc quotes have a messed-up encoding
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPRewritingConstants.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPRewritingConstants.java 2007-07-07 13:20:04 UTC (rev 7691)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/WSRPRewritingConstants.java 2007-07-09 08:32:55 UTC (rev 7692)
@@ -37,7 +37,7 @@
/**
* 10.2.1 <p>All portlet URLs (i.e. those the Consumer needs to rewrite) are demarcated in the markup by a token
- * (wsrp_rewrite) both at the start (with a �?� appended to clearly delimit the start of the name/value pairs).</p>
+ * (wsrp_rewrite) both at the start (with a "?" appended to clearly delimit the start of the name/value pairs).</p>
*/
public static final String BEGIN_WSRP_REWRITE = WSRP_REWRITE + "?";
@@ -45,7 +45,7 @@
/**
* 10.2.1 <p>All portlet URLs (i.e. those the Consumer needs to rewrite) are demarcated in the markup by a token
- * (wsrp_rewrite) at the end (proceeded by a �/� to form the end token) of the URL declaration.</p>
+ * (wsrp_rewrite) at the end (proceeded by a "/" to form the end token) of the URL declaration.</p>
*/
public static final String END_WSRP_REWRITE = "/" + WSRP_REWRITE;
@@ -68,7 +68,7 @@
/**
* 10.2.1.1.2 wsrp-urlType = render <p>Activation of the URL will result in an invocation of getMarkup(). This
- * mechanism permits a Portlet�s markup to contain URLs, which do not involve changes to local state, to avoid the
+ * mechanism permits a Portlet"s markup to contain URLs, which do not involve changes to local state, to avoid the
* overhead of two-step processing by directly invoking getMarkup(). The URL MAY specify a wsrp-navigationalState
* portlet URL parameter, whose value the Consumer MUST supply in the navigationalState field of the MarkupParams
* structure. If there is no such portlet URL parameter, the Consumer MUST NOT supply a value for this field.</p>
@@ -79,7 +79,7 @@
* 10.2.1.1.3 wsrp-urlType = resource <p>Activation of the URL will result in the Consumer acting as a gateway to the
* underlying resource, possibly in a cached manner, and returning it to the user-agent. The URL for the resource
* (including any query string parameters) is encoded as the value of the wsrp-url parameter. When a portlet URL
- * specifies �resource� for the wsrp-urlType portlet URL parameter, both the wsrp-url and wsrp-requiresRewrite
+ * specifies "resource" for the wsrp-urlType portlet URL parameter, both the wsrp-url and wsrp-requiresRewrite
* portlet URL parameters MUST also be specified. If the Portlet needs to share data with the referenced resource, it
* can exploit the cookie support defined in section 10.4.</p>
*/
@@ -88,7 +88,7 @@
/**
* 10.2.1.1.3.1 wsrp-url <p>This parameter provides the actual URL to the resource. Note that this needs to be an
* absolute URL as the resource fetch will have no base for use in fetching a relative URL. Also note that since this
- * resource URL will appear as a parameter value, it has to be strictly encoded (i.e. �&�, �=�, �/�, and �?� need to
+ * resource URL will appear as a parameter value, it has to be strictly encoded (i.e. "&", "=", "/", and "?" need to
* be url-escaped) so that special URL characters do not invalidate the processing of the enclosing URL. Consumers
* are encouraged to use the same communication style (e.g. HTTP Get or Post) for retrieving the resource as was used
* in requesting the resource by the user-agent.</p>
@@ -99,11 +99,11 @@
* 10.2.1.1.3.2 wsrp-requiresRewrite <p>This boolean informs the Consumer that the resource needs to be parsed for
* URL rewriting. Normally this means that there are names that will be cross-referenced between the markup and this
* resource (e.g. JavaScript references). Note that this means the Consumer needs to deal with rewriting unique
- * �namespaced� names in a set of documents, rather than treating each document individually. Processing such
- * resources in a manner that allows caching of the resulting resource by the End-User�s user-agent can improve the
+ * "namespaced" names in a set of documents, rather than treating each document individually. Processing such
+ * resources in a manner that allows caching of the resulting resource by the End-User"s user-agent can improve the
* performance of the aggregated page for the End-User. In particular, Consumers can process namespace rewriting by
* using a prefix that is unique to the user/Portlet pair provided any such prefix is held constant for the duration
- * of use within the user�s session with the Consumer of any one Portlet.</p>
+ * of use within the user"s session with the Consumer of any one Portlet.</p>
*/
public static final String RESOURCE_REQUIRES_REWRITE = "wsrp-requiresRewrite";
@@ -125,8 +125,8 @@
* 10.2.1.4 wsrp-mode <p>Activating this URL includes a request to change the mode parameter in MarkupParams into the
* mode specified as the value for this portlet URL parameter. The value for wsrp-mode MUST be one of the modes
* detailed in section 6.8 or a custom mode the Consumer specified as supported during registration. The wsrp-mode
- * portlet URL parameter MAY be used whenever the wsrp-urlType portlet URL parameter has a value of �blockingAction�
- * or �render�.</p>
+ * portlet URL parameter MAY be used whenever the wsrp-urlType portlet URL parameter has a value of "blockingAction"
+ * or "render".</p>
*/
public static final String MODE = "wsrp-mode";
@@ -135,7 +135,7 @@
* MarkupParams into the window state specified as the value for this portlet URL parameter. The value for wsrp-
* windowState MUST be one of the values detailed in section 6.9 or a custom window state the Consumer specified as
* supported during registration. The wsrp-windowState portlet URL parameter MAY be used whenever the wsrp-urlType
- * portlet URL parameter has a value of �blockingAction� or �render�.</p>
+ * portlet URL parameter has a value of "blockingAction" or "render".</p>
*/
public static final String WINDOW_STATE = "wsrp-windowState";
@@ -148,14 +148,14 @@
/**
* 10.2.1.7 wsrp-secureURL <p>The value for the wsrp-secureURL is a boolean indicating whether the resulting URL MUST
* involve secure communication between the client and Consumer, as well as between the Consumer and Producer. The
- * default value of this boolean is �false�. Note that the Consumer�s aggregated page MUST be secure if any of the
+ * default value of this boolean is "false". Note that the Consumer"s aggregated page MUST be secure if any of the
* Portlets whose content is being displayed on the page have indicated the need for secure communication for their
* current markup.</p>
*/
public static final String SECURE_URL = "wsrp-secureURL";
/**
- * 10.3.1 Consumer Rewriting (Namespace encoding) <p>The Portlet can prefix the token with �wsrp_rewrite_�. The
+ * 10.3.1 Consumer Rewriting (Namespace encoding) <p>The Portlet can prefix the token with "wsrp_rewrite_". The
* Consumer will locate such markers and MUST replace them with a prefix that is unique to this instance of this
* portlet on the page. This prefix has been chosen such that the Consumer is able to do a single parse of the markup
* to both locate such markers and the URL rewrite expressions described in section 10.2.1. In addition, this prefix
16 years, 11 months
JBoss Portal SVN: r7691 - in trunk: core-cms/src/main/org/jboss/portal/core/cms/ui/admin and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-07-07 09:20:04 -0400 (Sat, 07 Jul 2007)
New Revision: 7691
Added:
trunk/identity/src/main/org/jboss/portal/identity/AnonymousRole.java
trunk/identity/src/main/org/jboss/portal/identity/AnonymousUser.java
Removed:
trunk/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java
trunk/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java
Modified:
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
JBPORTAL-1543:Wrong two n in AnnonymousUser and AnnonymousRole class name
Modified: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-07-07 13:17:01 UTC (rev 7690)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -36,7 +36,7 @@
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.AnnonymousRole;
+import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.ldap.LDAPUserModule;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -248,7 +248,7 @@
{
Role role = (Role)itr.next();
PermRoleAssoc cour = new PermRoleAssoc();
- if(!(role instanceof AnnonymousRole))
+ if(!(role instanceof AnonymousRole))
{
cour.setRoleId(role.getName());
}
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-07-07 13:17:01 UTC (rev 7690)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -64,7 +64,7 @@
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.identity.AnnonymousRole;
+import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.MembershipModule;
import org.jboss.portal.identity.Role;
@@ -1299,7 +1299,7 @@
}
else
{
- role = new AnnonymousRole();
+ role = new AnonymousRole();
}
rolesSet.add(role);
}
Deleted: trunk/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java 2007-07-07 13:17:01 UTC (rev 7690)
+++ trunk/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -1,50 +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.identity;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class AnnonymousRole implements Role
-{
-
- public Object getId()
- {
- return new Long(0);
- }
-
- public String getName()
- {
- return "StandardAnnonymousPortalRole";
- }
-
- public String getDisplayName()
- {
- return "Portal Annonymous Role";
- }
-
- public void setDisplayName(String name)
- {
- //nothing
- }
-}
Deleted: trunk/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java 2007-07-07 13:17:01 UTC (rev 7690)
+++ trunk/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -1,52 +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.identity;
-
-import org.jboss.portal.identity.User;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class AnnonymousUser implements User
-{
-
- public Object getId()
- {
- return new Long(0);
- }
-
- public String getUserName()
- {
- return "StandardAnnonymousPortalUser";
- }
-
- public void updatePassword(String password)
- {
- //nothing
- }
-
- public boolean validatePassword(String password)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
Copied: trunk/identity/src/main/org/jboss/portal/identity/AnonymousRole.java (from rev 7690, branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousRole.java)
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/AnonymousRole.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/AnonymousRole.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -0,0 +1,50 @@
+/*
+* 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.identity;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnonymousRole implements Role
+{
+
+ public Object getId()
+ {
+ return new Long(0);
+ }
+
+ public String getName()
+ {
+ return "StandardAnonymousPortalRole";
+ }
+
+ public String getDisplayName()
+ {
+ return "Portal Anonymous Role";
+ }
+
+ public void setDisplayName(String name)
+ {
+ //nothing
+ }
+}
Copied: trunk/identity/src/main/org/jboss/portal/identity/AnonymousUser.java (from rev 7690, branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousUser.java)
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity/AnonymousUser.java (rev 0)
+++ trunk/identity/src/main/org/jboss/portal/identity/AnonymousUser.java 2007-07-07 13:20:04 UTC (rev 7691)
@@ -0,0 +1,50 @@
+/*
+* 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.identity;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnonymousUser implements User
+{
+
+ public Object getId()
+ {
+ return new Long(0);
+ }
+
+ public String getUserName()
+ {
+ return "StandardAnonymousPortalUser";
+ }
+
+ public void updatePassword(String password)
+ {
+ //nothing
+ }
+
+ public boolean validatePassword(String password)
+ {
+ return false;
+ }
+}
16 years, 11 months
JBoss Portal SVN: r7690 - in branches/JBoss_Portal_Branch_2_6: core-cms/src/main/org/jboss/portal/core/cms/ui/admin and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-07-07 09:17:01 -0400 (Sat, 07 Jul 2007)
New Revision: 7690
Added:
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousRole.java
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousUser.java
Removed:
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java
branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
JBPORTAL-1543:Wrong two n in AnnonymousUser and AnnonymousRole class name
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-07-06 18:57:51 UTC (rev 7689)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -36,7 +36,7 @@
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.AnnonymousRole;
+import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.ldap.LDAPUserModule;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -248,7 +248,7 @@
{
Role role = (Role)itr.next();
PermRoleAssoc cour = new PermRoleAssoc();
- if(!(role instanceof AnnonymousRole))
+ if(!(role instanceof AnonymousRole))
{
cour.setRoleId(role.getName());
}
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-07-06 18:57:51 UTC (rev 7689)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -64,7 +64,7 @@
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.identity.AnnonymousRole;
+import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.MembershipModule;
import org.jboss.portal.identity.Role;
@@ -1299,7 +1299,7 @@
}
else
{
- role = new AnnonymousRole();
+ role = new AnonymousRole();
}
rolesSet.add(role);
}
Deleted: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java 2007-07-06 18:57:51 UTC (rev 7689)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -1,50 +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.identity;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class AnnonymousRole implements Role
-{
-
- public Object getId()
- {
- return new Long(0);
- }
-
- public String getName()
- {
- return "StandardAnnonymousPortalRole";
- }
-
- public String getDisplayName()
- {
- return "Portal Annonymous Role";
- }
-
- public void setDisplayName(String name)
- {
- //nothing
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java 2007-07-06 18:57:51 UTC (rev 7689)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -1,52 +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.identity;
-
-import org.jboss.portal.identity.User;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
- */
-public class AnnonymousUser implements User
-{
-
- public Object getId()
- {
- return new Long(0);
- }
-
- public String getUserName()
- {
- return "StandardAnnonymousPortalUser";
- }
-
- public void updatePassword(String password)
- {
- //nothing
- }
-
- public boolean validatePassword(String password)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
Copied: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousRole.java (from rev 7686, branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousRole.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousRole.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousRole.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -0,0 +1,50 @@
+/*
+* 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.identity;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnonymousRole implements Role
+{
+
+ public Object getId()
+ {
+ return new Long(0);
+ }
+
+ public String getName()
+ {
+ return "StandardAnonymousPortalRole";
+ }
+
+ public String getDisplayName()
+ {
+ return "Portal Anonymous Role";
+ }
+
+ public void setDisplayName(String name)
+ {
+ //nothing
+ }
+}
Copied: branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousUser.java (from rev 7686, branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnnonymousUser.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousUser.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/identity/src/main/org/jboss/portal/identity/AnonymousUser.java 2007-07-07 13:17:01 UTC (rev 7690)
@@ -0,0 +1,50 @@
+/*
+* 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.identity;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnonymousUser implements User
+{
+
+ public Object getId()
+ {
+ return new Long(0);
+ }
+
+ public String getUserName()
+ {
+ return "StandardAnonymousPortalUser";
+ }
+
+ public void updatePassword(String password)
+ {
+ //nothing
+ }
+
+ public boolean validatePassword(String password)
+ {
+ return false;
+ }
+}
16 years, 11 months
JBoss Portal SVN: r7689 - trunk/core/src/main/org/jboss/portal/core/impl/model/portal.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-06 14:57:51 -0400 (Fri, 06 Jul 2007)
New Revision: 7689
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
- JBPORTAL-1541: check for null parent.
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-07-06 18:56:20 UTC (rev 7688)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-07-06 18:57:51 UTC (rev 7689)
@@ -23,21 +23,21 @@
package org.jboss.portal.core.impl.model.portal;
import org.apache.log4j.Logger;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.common.NotYetImplemented;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.HashSet;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -211,7 +211,7 @@
else
{
int count = 0;
- for (Iterator i = iterator();i.hasNext();)
+ for (Iterator i = iterator(); i.hasNext();)
{
i.next();
count++;
@@ -280,7 +280,7 @@
{
ObjectNode childNode = (ObjectNode)iterator.next();
PortalObjectImpl childObject = childNode.getObject();
- if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
+ if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
{
nextChild = childObject;
}
@@ -395,9 +395,7 @@
return accessedChildren;
}
- /**
- * Get the aggregated properties in a lazy manner.
- */
+ /** Get the aggregated properties in a lazy manner. */
public Map getProperties()
{
// Lazy compute properties
@@ -457,7 +455,13 @@
if (value == null)
{
declaredPropertyMap.remove(name);
- String parentValue = getParent().getProperty(name);
+ PortalObject parent = getParent();
+ String parentValue = null;
+ if (parent != null)
+ {
+ parentValue = parent.getProperty(name);
+ }
+
propagatePropertyUpdate(name, parentValue, true);
}
else
@@ -468,15 +472,15 @@
}
/**
- * This method propagates a property value update to descendants which have been *loaded* from the database.
- * It considers that if the <code>properties</code> field of the runtime state is null then it means that
- * the object is loaded but children have not made an attempt to read the properties of this object. Indeed
- * if a child is loaded any attempt to access its aggregated properties will trigger the computation of
- * the aggregated properties of this object.
- *
+ * This method propagates a property value update to descendants which have been *loaded* from the database. It
+ * considers that if the <code>properties</code> field of the runtime state is null then it means that the object is
+ * loaded but children have not made an attempt to read the properties of this object. Indeed if a child is loaded
+ * any attempt to access its aggregated properties will trigger the computation of the aggregated properties of this
+ * object.
+ * <p/>
* Null property values are considered as removal
*
- * @param name the property name
+ * @param name the property name
* @param value the new property value
* @param force the update
*/
@@ -561,9 +565,7 @@
protected abstract PortalObjectImpl cloneObject();
- /**
- * Overridable callback.
- */
+ /** Overridable callback. */
protected void destroy()
{
}
@@ -573,9 +575,7 @@
return getMask(getType());
}
- /**
- * Returns the mask for this kind of object.
- */
+ /** Returns the mask for this kind of object. */
protected final int getMask(int portalObjectType)
{
switch (portalObjectType)
@@ -639,7 +639,7 @@
// Clone children recursively
if (deep)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator i = getChildren().iterator(); i.hasNext();)
{
PortalObjectImpl child = (PortalObjectImpl)i.next();
@@ -651,6 +651,4 @@
//
return clone;
}
-}
-
-
+}
\ No newline at end of file
16 years, 12 months
JBoss Portal SVN: r7688 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-06 14:56:20 -0400 (Fri, 06 Jul 2007)
New Revision: 7688
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
Log:
- JBPORTAL-1541: Check for null parent.
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-07-06 17:03:44 UTC (rev 7687)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-07-06 18:56:20 UTC (rev 7688)
@@ -23,21 +23,21 @@
package org.jboss.portal.core.impl.model.portal;
import org.apache.log4j.Logger;
+import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.common.NotYetImplemented;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
-import java.util.HashSet;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -211,7 +211,7 @@
else
{
int count = 0;
- for (Iterator i = iterator();i.hasNext();)
+ for (Iterator i = iterator(); i.hasNext();)
{
i.next();
count++;
@@ -280,7 +280,7 @@
{
ObjectNode childNode = (ObjectNode)iterator.next();
PortalObjectImpl childObject = childNode.getObject();
- if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
+ if (mask == ALL_TYPES_MASK || (childObject.getMask() & mask) != 0)
{
nextChild = childObject;
}
@@ -395,9 +395,7 @@
return accessedChildren;
}
- /**
- * Get the aggregated properties in a lazy manner.
- */
+ /** Get the aggregated properties in a lazy manner. */
public Map getProperties()
{
// Lazy compute properties
@@ -457,7 +455,13 @@
if (value == null)
{
declaredPropertyMap.remove(name);
- String parentValue = getParent().getProperty(name);
+ PortalObject parent = getParent();
+ String parentValue = null;
+ if (parent != null)
+ {
+ parentValue = parent.getProperty(name);
+ }
+
propagatePropertyUpdate(name, parentValue, true);
}
else
@@ -468,44 +472,44 @@
}
/**
- * This method propagates a property value update to descendants which have been *loaded* from the database.
- * It considers that if the <code>properties</code> field of the runtime state is null then it means that
- * the object is loaded but children have not made an attempt to read the properties of this object. Indeed
- * if a child is loaded any attempt to access its aggregated properties will trigger the computation of
- * the aggregated properties of this object.
- *
+ * This method propagates a property value update to descendants which have been *loaded* from the database. It
+ * considers that if the <code>properties</code> field of the runtime state is null then it means that the object is
+ * loaded but children have not made an attempt to read the properties of this object. Indeed if a child is loaded
+ * any attempt to access its aggregated properties will trigger the computation of the aggregated properties of this
+ * object.
+ * <p/>
* Null property values are considered as removal
*
- * @param name the property name
+ * @param name the property name
* @param value the new property value
* @param force the update
*/
private void propagatePropertyUpdate(String name, String value, boolean force)
{
- if (properties != null)
- {
- if (force || !declaredPropertyMap.containsKey(name))
- {
- if (value == null)
- {
- properties.remove(name);
- }
- else
- {
- properties.put(name, value);
- }
+ if (properties != null)
+ {
+ if (force || !declaredPropertyMap.containsKey(name))
+ {
+ if (value == null)
+ {
+ properties.remove(name);
+ }
+ else
+ {
+ properties.put(name, value);
+ }
- //
- if (accessedChildren != null)
+ //
+ if (accessedChildren != null)
+ {
+ for (Iterator i = accessedChildren.iterator(); i.hasNext();)
{
- for (Iterator i = accessedChildren.iterator(); i.hasNext();)
- {
- PortalObjectImpl child = (PortalObjectImpl)i.next();
- child.propagatePropertyUpdate(name, value, false);
- }
+ PortalObjectImpl child = (PortalObjectImpl)i.next();
+ child.propagatePropertyUpdate(name, value, false);
}
- }
- }
+ }
+ }
+ }
}
public String getProperty(String name)
@@ -561,9 +565,7 @@
protected abstract PortalObjectImpl cloneObject();
- /**
- * Overridable callback.
- */
+ /** Overridable callback. */
protected void destroy()
{
}
@@ -573,9 +575,7 @@
return getMask(getType());
}
- /**
- * Returns the mask for this kind of object.
- */
+ /** Returns the mask for this kind of object. */
protected final int getMask(int portalObjectType)
{
switch (portalObjectType)
@@ -639,7 +639,7 @@
// Clone children recursively
if (deep)
{
- for (Iterator i = getChildren().iterator();i.hasNext();)
+ for (Iterator i = getChildren().iterator(); i.hasNext();)
{
PortalObjectImpl child = (PortalObjectImpl)i.next();
16 years, 12 months
JBoss Portal SVN: r7687 - in branches/JBoss_Portal_Branch_2_6/demo: conf and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-06 13:03:44 -0400 (Fri, 06 Jul 2007)
New Revision: 7687
Added:
branches/JBoss_Portal_Branch_2_6/demo/conf/demo-wsrp.xml
Modified:
branches/JBoss_Portal_Branch_2_6/demo/build.xml
Log:
- Added demo-wsrp.xml to override self definition and to add more consumers.
- Updated build (but needs to be tested for proper behavior wrt default-wsrp.xml).
Modified: branches/JBoss_Portal_Branch_2_6/demo/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/demo/build.xml 2007-07-06 14:31:35 UTC (rev 7686)
+++ branches/JBoss_Portal_Branch_2_6/demo/build.xml 2007-07-06 17:03:44 UTC (rev 7687)
@@ -21,13 +21,28 @@
<target name="delete-objectsdescriptors">
<delete>
- <fileset dir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar" includes="**/*-object.xml"/>
+ <fileset dir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar"
+ includes="**/*-object.xml"/>
</delete>
</target>
<target name="install-objectsdescriptor">
- <copy file="conf/default-object.xml" todir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar/conf/data"/>
+ <copy file="conf/default-object.xml"
+ todir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar/conf/data"/>
</target>
+
+ <target name="install-wsrpdescriptor">
+ <copy file="conf/demo-wsrp.xml" todir="${destination.dir}/${portal.name.dir}/server/default/deploy"/>
+ </target>
+
+ <target name="delete-wsrpdescriptors">
+ <!--
+ Would that delete default-wsrp.xml in jboss-portal.sar/portal-wspr.sar/? This would be nice so that we can
+ override the self definition with the one that's in demo-wsrp.xml.
+ -->
+ <delete dir="${destination.dir}/${portal.name.dir}/server/default/deploy" includes="**/*-wsrp.xml"/>
+ </target>
+
<target name="clean">
<delete dir="${destination.dir}/${portal.name.dir}"/>
@@ -38,7 +53,8 @@
<target name="update-context">
<delete dir="${destination.dir}/${portal.name.dir}/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war"/>
- <copy overwrite="true" file="conf/jboss-web.xml" todir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF"/>
+ <copy overwrite="true" file="conf/jboss-web.xml"
+ todir="${destination.dir}/${portal.name.dir}/server/default/deploy/jboss-portal.sar/portal-server.war/WEB-INF"/>
</target>
<target name="install-flickrportlet">
@@ -58,9 +74,9 @@
<fileset dir="portlets/jbossforums"/>
</copy>
</target>
-
- <!-- Fix WS issues on JBoss 4.0.x -->
- <target name="update-ws">
+
+ <!-- Fix WS issues on JBoss 4.0.x -->
+ <target name="update-ws">
<unzip src="${jbossws.location}" dest="${tmp.dir}/jbossws"/>
<ant inheritAll="false" dir="${tmp.dir}/jbossws" antfile="build.xml" target="deploy-jboss40-jdk14">
<property name="jboss40.home" value="${destination.dir}/${portal.name.dir}"/>
@@ -74,8 +90,12 @@
</copy>
</target>
- <target name="main" depends="unzip-bundle, delete-docs, delete-jmxconsole, delete-objectsdescriptors, update-context, update-ws, install-objectsdescriptor, install-jbossforums, activate-workflow, install-flickrportlet">
- <tar destfile="${destination.dir}/${portal.name.dir}.tar" basedir="${destination.dir}/${portal.name.dir}" longfile="gnu"/>
+ <target name="main"
+ depends="unzip-bundle, delete-docs, delete-jmxconsole, delete-objectsdescriptors, delete-wsrpdescriptors,
+ update-context, update-ws, install-objectsdescriptor, install-wsrpdescriptor, install-jbossforums, activate-workflow,
+ install-flickrportlet">
+ <tar destfile="${destination.dir}/${portal.name.dir}.tar" basedir="${destination.dir}/${portal.name.dir}"
+ longfile="gnu"/>
<gzip zipfile="${destination.dir}/${portal.name.dir}.tgz" src="${destination.dir}/${portal.name.dir}.tar"/>
<delete file="${destination.dir}/${portal.name.dir}.tar"/>
</target>
Copied: branches/JBoss_Portal_Branch_2_6/demo/conf/demo-wsrp.xml (from rev 7686, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/demo/conf/demo-wsrp.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/demo/conf/demo-wsrp.xml 2007-07-06 17:03:44 UTC (rev 7687)
@@ -0,0 +1,86 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <wsrp-producer id="self" expiration-cache="300">
+ <!--
+ we need to use the individual endpoint configuration because the configuration via wsdl forces an
+ immediate attempt to access the web service description which is not available yet at this point of deployment
+ -->
+ <endpoint-config>
+ <service-description-url>http://portal.demo.jboss.com:8080/portal-wsrp/ServiceDescriptionService</service-description-url>
+ <markup-url>http://portal.demo.jboss.com:8080/portal-wsrp/MarkupService</markup-url>
+ <registration-url>http://portal.demo.jboss.com:8080/portal-wsrp/RegistrationService</registration-url>
+ <portlet-management-url>http://portal.demo.jboss.com:8080/portal-wsrp/PortletManagementService</portlet-management-url>
+ </endpoint-config>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+ <deployment>
+ <wsrp-producer id="NetUnity Public Producer" expiration-cache="3000">
+ <endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Ope...</endpoint-wsdl-url>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+ <!--<deployment>
+ <wsrp-producer id="vignette" expiration-cache="300">
+ <endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>com.vignette.wsrp.registration.username</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ <property>
+ <name>com.vignette.wsrp.registration.password</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>-->
+ <deployment>
+ <wsrp-producer id="BEA Public Producer" expiration-cache="3000">
+ <endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>registration/consumerRole</name>
+ <lang>en</lang>
+ <value>public</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>
+ <deployment>
+ <wsrp-producer id="Oracle Public Producer" expiration-cache="3000">
+ <endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+</deployments>
\ No newline at end of file
16 years, 12 months
JBoss Portal SVN: r7686 - in branches/JBoss_Portal_Branch_2_6: common/src/main/org/jboss/portal/common/xml and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-07-06 10:31:35 -0400 (Fri, 06 Jul 2007)
New Revision: 7686
Added:
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/widget/google/GGWidgetInfo.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/resources/test/google/queryresult1.xml
Removed:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java
Modified:
branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/net/URLTools.java
branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/xml/XMLTools.java
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/widget/google/GGPreferencesInfo.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.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/resources/widget-war/WEB-INF/jsp/edit.jsp
Log:
URLTools : make the performGET honour its contract by returning null if no content was retrieved
XMLTools: update to take in account namespaces during in DOM browsing
Widgets: parse rather the XML feed returned by the widget directory rather than parsing the HTML returned and added a test case that builds widget description from an rss feed snapshot
Modified: branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/net/URLTools.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/net/URLTools.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/net/URLTools.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -81,7 +81,7 @@
* @param url the URL the URL of the resource
* @param soTimeoutMillis the socket connection timeout in millis
* @param connTimeoutMillis the connection timeout in millis
- * @return
+ * @return the retrieved byte array
*/
public static byte[] performGET(URL url, int soTimeoutMillis, int connTimeoutMillis) throws IllegalArgumentException, IOException
{
@@ -135,8 +135,11 @@
method.releaseConnection();
}
}
+
+ //
+ return null;
}
- throw new IllegalArgumentException("Protocol " + url.getProtocol() + " not accepted");
+ throw new IllegalArgumentException("Protocol " + url.getProtocol() + " not accepted for url " + url);
}
/**
Modified: branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/xml/XMLTools.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/xml/XMLTools.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/common/src/main/org/jboss/portal/common/xml/XMLTools.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -313,7 +313,25 @@
public static Element getUniqueChild(Element element, String name, boolean strict) throws IllegalArgumentException,
NoSuchElementException, TooManyElementException
{
- List list = getChildren(element, name);
+ return getUniqueChild(element, null, name, strict);
+ }
+
+ /**
+ * Return an optional child of an element with the specified name and the optionally specified namespace uri.
+ *
+ * @param element the parent element
+ * @param name the child name
+ * @param uri the child uri
+ * @param strict if the child must be present
+ * @return the child element or null if it does not exist and strict is set to false
+ * @throws IllegalArgumentException if an argument is null
+ * @throws NoSuchElementException if strict is true and the element is not present
+ * @throws TooManyElementException if more than one element is found
+ */
+ public static Element getUniqueChild(Element element, String uri, String name, boolean strict) throws IllegalArgumentException,
+ NoSuchElementException, TooManyElementException
+ {
+ List list = getChildren(element, uri, name);
switch (list.size())
{
case 0:
@@ -346,6 +364,21 @@
}
/**
+ * Return an iterator for all the children of the given element having the specified name and the optionally
+ * specified namesspace uri.
+ *
+ * @param element the parent element
+ * @param uri the children uri
+ * @param name the children name
+ * @return an iterator for the designated elements
+ * @throws IllegalArgumentException if the element is null or the name is null
+ */
+ public static Iterator getChildrenIterator(Element element, String uri, String name) throws IllegalArgumentException
+ {
+ return getChildren(element, uri, name).iterator();
+ }
+
+ /**
* Return all the children of the given element having the specified name. The collection object can be modified.
*
* @param element the parent element
@@ -355,6 +388,21 @@
*/
public static List getChildren(Element element, String name) throws IllegalArgumentException
{
+ return getChildren(element, null, name);
+ }
+
+ /**
+ * Return all the children of the given element having the specified name and the optionally specified namespace URI.
+ * The collection object can be modified.
+ *
+ * @param element the parent element
+ * @param uri the children uri
+ * @param name the children name
+ * @return a list of elements
+ * @throws IllegalArgumentException if the element is null or the name is null
+ */
+ public static List getChildren(Element element, String uri, String name) throws IllegalArgumentException
+ {
if (element == null)
{
throw new IllegalArgumentException("No element found");
@@ -371,10 +419,22 @@
if (node.getNodeType() == Node.ELEMENT_NODE)
{
Element childElt = (Element)node;
- if (childElt.getTagName().equals(name))
+
+ //
+ if (uri == null)
{
- result.add(childElt);
+ if (childElt.getTagName().equals(name))
+ {
+ result.add(childElt);
+ }
}
+ else if (uri.equals(childElt.getNamespaceURI()))
+ {
+ if (childElt.getLocalName().equals(name))
+ {
+ result.add(childElt);
+ }
+ }
}
}
return result;
Modified: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-07-06 14:31:35 UTC (rev 7686)
@@ -250,17 +250,19 @@
<target name="tests" depends="init, package-tests">
<property name="proto-libs" value="${project.root}/proto-libs"/>
<execute-tests>
+
<!--
-
<x-sysproperty>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
</x-sysproperty>
-->
-
<x-test>
+<!--
<test todir="${test.reports}" name="org.jboss.portal.test.widget.google.PreferencesTestCase"/>
+-->
+ <test todir="${test.reports}" name="org.jboss.portal.test.widget.google.QueryResultParserTestCase"/>
</x-test>
<x-classpath>
<pathelement location="${build.lib}/widget-lib.jar"/>
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-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/PreferencesTestCase.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -23,10 +23,10 @@
package org.jboss.portal.test.widget.google;
import junit.framework.TestCase;
-import org.jboss.portal.widget.google.provider.GGWidgetBuilder;
-import org.jboss.portal.widget.google.GGWidget;
+import org.jboss.portal.widget.google.provider.GGWidgetInfoBuilder;
import org.jboss.portal.widget.google.GGPreferencesInfo;
import org.jboss.portal.widget.google.GGPreferenceInfo;
+import org.jboss.portal.widget.google.GGWidgetInfo;
import org.jboss.portal.widget.google.type.DataType;
import org.jboss.portal.widget.google.type.EnumType;
import org.jboss.portal.common.io.IOTools;
@@ -47,12 +47,12 @@
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
URL url = tcl.getResource("google/gadget1.xml");
- GGWidgetBuilder ggwb = constructBuilder(url);
- GGWidget ggw = ggwb.create();
+ GGWidgetInfoBuilder ggwb = constructBuilder(url);
+ GGWidgetInfo ggw = ggwb.create();
assertNotNull(ggw);
- assertEquals("TestTitle",ggw.getTitle().getDefaultString());
- assertEquals("TestDescription",ggw.getDescription().getDefaultString());
+// assertEquals("TestTitle",ggw.getTitle().getDefaultString());
+// assertEquals("TestDescription",ggw.getDescription().getDefaultString());
}
public void testUserPrefs() throws Exception
@@ -60,15 +60,15 @@
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
URL url = tcl.getResource("google/gadget2.xml");
- GGWidgetBuilder ggwb = constructBuilder(url);
- GGWidget ggw = ggwb.create();
+ GGWidgetInfoBuilder ggwb = constructBuilder(url);
+ GGWidgetInfo ggw = ggwb.create();
assertNotNull(ggw);
- GGPreferencesInfo prefs = ggw.getPreferencesInfo();
+ GGPreferencesInfo prefs = ggw.getPreferences();
// String
- GGPreferenceInfo pi = prefs.getPreferenceInfo("testString");
+ GGPreferenceInfo pi = prefs.getPreference("testString");
assertNotNull(pi);
assertEquals("testString", pi.getName());
assertEquals("Test String", pi.getDisplayName());
@@ -76,7 +76,7 @@
assertEquals(DataType.STRING, pi.getType().getOrdinal());
// Default
- pi = prefs.getPreferenceInfo("testDefault");
+ pi = prefs.getPreference("testDefault");
assertNotNull(pi);
assertEquals("testDefault", pi.getName());
assertEquals("Test Default", pi.getDisplayName());
@@ -84,7 +84,7 @@
assertEquals(DataType.STRING, pi.getType().getOrdinal());
// Required
- pi = prefs.getPreferenceInfo("testRequired");
+ pi = prefs.getPreference("testRequired");
assertNotNull(pi);
assertEquals("testRequired", pi.getName());
assertEquals("Test Required", pi.getDisplayName());
@@ -93,7 +93,7 @@
assertTrue(pi.isRequired());
// Enum
- pi = prefs.getPreferenceInfo("testEnum");
+ pi = prefs.getPreference("testEnum");
assertNotNull(pi);
assertEquals("testEnum", pi.getName());
assertEquals("Test Enum", pi.getDisplayName());
@@ -109,7 +109,7 @@
assertEquals("enumThree", enumer.getValue(2).getDisplayValue());
// Bool
- pi = prefs.getPreferenceInfo("testBool");
+ pi = prefs.getPreference("testBool");
assertNotNull(pi);
assertEquals("testBool", pi.getName());
assertEquals("Test Bool", pi.getDisplayName());
@@ -117,7 +117,7 @@
assertEquals(DataType.BOOL, pi.getType().getOrdinal());
// Hidden
- pi = prefs.getPreferenceInfo("testHidden");
+ pi = prefs.getPreference("testHidden");
assertNotNull(pi);
assertEquals("testHidden", pi.getName());
assertEquals("Test Hidden", pi.getDisplayName());
@@ -125,7 +125,7 @@
assertEquals(DataType.HIDDEN, pi.getType().getOrdinal());
// List
- pi = prefs.getPreferenceInfo("testList");
+ pi = prefs.getPreference("testList");
assertNotNull(pi);
assertEquals("testList", pi.getName());
assertEquals("Test List", pi.getDisplayName());
@@ -138,9 +138,9 @@
}
- public GGWidgetBuilder constructBuilder(URL url) throws Exception
+ public GGWidgetInfoBuilder constructBuilder(URL url) throws Exception
{
- return new GGWidgetBuilder(url)
+ return new GGWidgetInfoBuilder(url)
{
protected byte[] obtainWidget(URL url) throws Exception
{
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java (from rev 7678, trunk/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 (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/test/widget/google/QueryResultParserTestCase.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * 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 java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.jboss.portal.widget.google.provider.GGQueryResultBuilder;
+import org.jboss.portal.widget.google.provider.GGQueryResult;
+import org.jboss.portal.widget.google.provider.GGQueryResultEntry;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class QueryResultParserTestCase extends TestCase
+{
+
+ public void testA() throws MalformedURLException
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ URL url = tcl.getResource("google/queryresult1.xml");
+ assertNotNull(url);
+ GGQueryResultBuilder builder = new GGQueryResultBuilder(url);
+ GGQueryResult result = builder.build();
+ assertNotNull(result);
+ 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());
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGPreferencesInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGPreferencesInfo.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGPreferencesInfo.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -35,6 +35,7 @@
public final class GGPreferencesInfo
{
+ /** . */
public static final GGPreferencesInfo EMPTY_PREFS = new GGPreferencesInfo();
/** . */
@@ -59,12 +60,12 @@
content = null;
}
- public Collection getPreferencesInfo()
+ public Collection getPreferences()
{
return content == null ? Collections.EMPTY_SET : content.values();
}
- public GGPreferenceInfo getPreferenceInfo(String name)
+ public GGPreferenceInfo getPreference(String name)
{
if (name == null)
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -29,9 +29,11 @@
import java.util.Iterator;
import java.util.Map;
+import java.net.URL;
/**
- * A Google Gadget widget For more details please see the <a href="http://www.google.com/apis/gadgets/reference.html">API Developer Guide</a>.
+ * A Google Gadget widget.
+ * For more details please see the <a href="http://www.google.com/apis/gadgets/reference.html">API Developer Guide</a>.
*
* @todo
* - Resource bundles implementation
@@ -46,56 +48,39 @@
private static final UUIDGenerator generator = new UUIDGenerator();
/** . */
- private final String url;
+ private final URL url;
/** . */
- private final GGPreferencesInfo prefsInfo;
+ private final String id;
/** . */
- private final LocalizedString title;
+ private final GGWidgetInfo info;
- /** . */
- private final LocalizedString description;
-
- /** . */
- private final int width;
-
- /** . */
- private final int height;
-
- public GGWidget(String url,
- GGPreferencesInfo prefsInfo,
- LocalizedString title,
- LocalizedString description,
- int width,
- int height)
+ public GGWidget(URL url, GGWidgetInfo info)
{
+ this.id = url.toString();
this.url = url;
- this.prefsInfo = prefsInfo;
- this.title = title;
- this.description = description;
- this.width = width;
- this.height = height;
+ this.info = info;
}
public String getId()
{
- return url;
+ return id;
}
- public GGPreferencesInfo getPreferencesInfo()
+ public GGWidgetInfo getInfo()
{
- return prefsInfo;
+ return info;
}
public LocalizedString getTitle()
{
- return title;
+ return getInfo().getTitle();
}
public LocalizedString getDescription()
{
- return description;
+ return getInfo().getDescription();
}
public String render(Map parameters)
@@ -103,46 +88,58 @@
String id = generator.generateKey();
StringBuffer tmp = new StringBuffer("http://gmodules.com/ig/ifr?url=").append(url);
- // Generate base params
- tmp.append("&synd=open");
- tmp.append("&w=").append(width);
- tmp.append("&h=").append(height);
- tmp.append("&title=").append(FastURLEncoder.DEFAULT_ENCODER.encode(title.getDefaultString()));
- tmp.append("&border=%23ffffff%7C3px%2C1px+none+%23999999"); // "&border=%23ffffff%7C3px%2C1px+solid+%23999999"
- tmp.append("&output=js");
+ //
+ GGWidgetInfo info = getInfo();
- // Append default values
- for (Iterator i = prefsInfo.getPreferencesInfo().iterator();i.hasNext();)
+ //
+ if (info != null)
{
- GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
- String prefName = prefInfo.getName();
- String[] values = (String[])parameters.get(prefName);
- String value = values != null ? values[0] : prefInfo.getDefaultValue();
- if (value != null)
+ // Generate base params
+ tmp.append("&synd=open");
+ tmp.append("&w=").append(info.getWidth());
+ tmp.append("&h=").append(info.getHeight());
+ tmp.append("&title=").append(FastURLEncoder.DEFAULT_ENCODER.encode(info.getTitle().getDefaultString()));
+ tmp.append("&border=%23ffffff%7C3px%2C1px+none+%23999999"); // "&border=%23ffffff%7C3px%2C1px+solid+%23999999"
+ tmp.append("&output=js");
+
+ //
+ GGPreferencesInfo prefsInfo = info.getPreferences();
+
+ // Append default values
+ for (Iterator i = prefsInfo.getPreferences().iterator();i.hasNext();)
{
- tmp.append("&up_").append(FastURLEncoder.DEFAULT_ENCODER.encode(prefName)).append("=").append(FastURLEncoder.DEFAULT_ENCODER.encode(value));
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+ String prefName = prefInfo.getName();
+ String[] values = (String[])parameters.get(prefName);
+ String value = values != null ? values[0] : prefInfo.getDefaultValue();
+ if (value != null)
+ {
+ tmp.append("&up_").append(FastURLEncoder.DEFAULT_ENCODER.encode(prefName)).append("=").append(FastURLEncoder.DEFAULT_ENCODER.encode(value));
+ }
}
- }
- //
- String clipper = "" +
- "(function(){\n" +
- "var a = document.getElementById('" + id + "');\n" +
- "var b = a.childNodes.item(2);\n" + // table
- "var c = b.childNodes.item(0);\n" + // tbody
- "var d = c.childNodes.item(0);\n" + // tr
- "var e = c.childNodes.item(1);\n" + // tr
- "var f = c.childNodes.item(3);\n" + // tr
- "c.removeChild(d);\n" +
- "c.removeChild(e);\n" +
- "c.removeChild(f);\n" +
- "})();";
+ //
+ String clipper = "" +
+ "(function(){\n" +
+ "var a = document.getElementById('" + id + "');\n" +
+ "var b = a.childNodes.item(2);\n" + // table
+ "var c = b.childNodes.item(0);\n" + // tbody
+ "var d = c.childNodes.item(0);\n" + // tr
+ "var e = c.childNodes.item(1);\n" + // tr
+ "var f = c.childNodes.item(3);\n" + // tr
+ "c.removeChild(d);\n" +
+ "c.removeChild(e);\n" +
+ "c.removeChild(f);\n" +
+ "})();";
- return "<div id=\"" + id + "\">\n" +
- "<script src=\"" + tmp + "\"></script>\n" +
- "<script>" + clipper + "</script>\n" +
- "</div>\n";
+ return "<div id=\"" + id + "\">\n" +
+ "<script src=\"" + tmp + "\"></script>\n" +
+ "<script>" + clipper + "</script>\n" +
+ "</div>\n";
+ }
+ else
+ {
+ return "Error";
+ }
}
-
-
}
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetInfo.java (from rev 7678, trunk/widget/src/main/org/jboss/portal/widget/google/GGWidgetInfo.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetInfo.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidgetInfo.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.google;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * Meta data retrieved from the XML file.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GGWidgetInfo
+{
+
+ /** . */
+ private final LocalizedString title;
+
+ /** . */
+ private final LocalizedString description;
+
+ /** . */
+ private final int width;
+
+ /** . */
+ private final int height;
+
+ /** . */
+ private final GGPreferencesInfo preferences;
+
+ public GGWidgetInfo(
+ LocalizedString title,
+ LocalizedString description,
+ int width,
+ int height,
+ GGPreferencesInfo preferences)
+ {
+ this.title = title;
+ this.description = description;
+ this.width = width;
+ this.height = height;
+ this.preferences = preferences;
+ }
+
+ public GGPreferencesInfo getPreferences()
+ {
+ return preferences;
+ }
+
+ public LocalizedString getTitle()
+ {
+ return title;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public int getHeight()
+ {
+ return height;
+ }
+}
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-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -35,9 +35,12 @@
import java.net.MalformedURLException;
import java.util.Collections;
import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
import org.jboss.portal.widget.google.GGWidget;
import org.jboss.portal.widget.google.GGWidgetCategoryInfo;
+import org.jboss.portal.widget.google.GGWidgetInfo;
import org.jboss.portal.common.util.CollectionBuilder;
/**
@@ -57,9 +60,6 @@
private final ConcurrentMap searches = new ConcurrentHashMap();
/** . */
- private final Context context = new Context();
-
- /** . */
private ExecutorService executor;
/** . */
@@ -91,6 +91,9 @@
return CATEGORIES;
}
+ /**
+ * Returns a specified widget.
+ */
public GGWidget getWidget(String id)
{
if (id == null)
@@ -102,49 +105,69 @@
try
{
URL url = new URL(id);
- return context.getWidgetEntry(url).getWidget();
+ return getWidget(url);
}
catch (MalformedURLException e)
{
e.printStackTrace();
+
+ //
return null;
}
}
- public GGQueryResult search(GGQuery query)
+ /**
+ * Returns a specified widget.
+ */
+ private GGWidget getWidget(URL url)
{
+ GGProvider.GGWidgetEntry tmp = new GGProvider.GGWidgetEntry(url);
+ GGProvider.GGWidgetEntry entry = (GGProvider.GGWidgetEntry)entries.putIfAbsent(url, tmp);
+ if (entry == null)
+ {
+ entry = tmp;
+ entry.retrieve();
+ }
+ return entry.getWidget();
+ }
+
+ /**
+ * Returns a collection of widgets from a query.
+ */
+ public Collection search(GGQuery query)
+ {
if (query == null)
{
throw new IllegalArgumentException();
}
//
- QueryEntry tmp = new QueryEntry(query);
- QueryEntry entry = (QueryEntry)searches.putIfAbsent(query, tmp);
+ GGQueryEntry tmp = new GGQueryEntry(query);
+ GGQueryEntry entry = (GGQueryEntry)searches.putIfAbsent(query, tmp);
if (entry == null)
{
entry = tmp;
entry.retrieve();
}
- return entry.getResult();
- }
+ GGQueryResult result = entry.getResult();
- public class Context
- {
- GGProvider.GGWidgetEntry getWidgetEntry(URL url)
+ //
+ Collection widgets = new ArrayList();
+ for (Iterator i = result.entries();i.hasNext();)
{
- GGProvider.GGWidgetEntry tmp = new GGProvider.GGWidgetEntry(url);
- GGProvider.GGWidgetEntry entry = (GGProvider.GGWidgetEntry)entries.putIfAbsent(url, tmp);
- if (entry == null)
+ GGQueryResultEntry resultEntry = (GGQueryResultEntry)i.next();
+ GGWidget widget = getWidget(resultEntry.getURL());
+ if (widget != null)
{
- entry = tmp;
- entry.retrieve();
+ widgets.add(widget);
}
- return entry;
}
+
+ //
+ return widgets;
}
- public class GGWidgetEntry implements Callable
+ private class GGWidgetEntry implements Callable
{
/** The widget id. */
@@ -172,27 +195,29 @@
}
catch (Exception e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace();
+
+ //
return null;
}
}
- public Object call()
+ public Object call() throws Exception
{
- try
+ GGWidgetInfoBuilder builder = new GGWidgetInfoBuilder(url);
+ GGWidgetInfo info = builder.create();
+ if (info != null)
{
- GGWidgetBuilder builder = new GGWidgetBuilder(url);
- return builder.create();
+ return new GGWidget(url, info);
}
- catch (Exception e)
+ else
{
- e.printStackTrace();
return null;
}
}
}
- private class QueryEntry implements Callable
+ private class GGQueryEntry implements Callable
{
/** . */
@@ -201,7 +226,7 @@
/** . */
private FutureTask future;
- public QueryEntry(GGQuery query)
+ public GGQueryEntry(GGQuery query)
{
this.query = query;
this.future = new FutureTask(this);
@@ -214,21 +239,31 @@
public GGQueryResult getResult()
{
+ GGQueryResult result = null;
+
+ //
try
{
- return (GGQueryResult)future.get();
+ result = (GGQueryResult)future.get();
}
catch (Exception e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- return new GGQueryResult(query, Collections.EMPTY_LIST);
+ e.printStackTrace();
}
+
+ //
+ if (result == null)
+ {
+ result = new GGQueryResult(Collections.EMPTY_LIST);
+ }
+
+ //
+ return result;
}
- public Object call()
+ public Object call() throws MalformedURLException
{
- GGQueryResultBuilder builder = new GGQueryResultBuilder(query);
- return builder.build(context);
+ return new GGQueryResultBuilder(query).build();
}
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQuery.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -22,6 +22,9 @@
******************************************************************************/
package org.jboss.portal.widget.google.provider;
+import java.net.URL;
+import java.net.MalformedURLException;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -109,4 +112,26 @@
{
return hashCode;
}
+
+ URL buildQueryURL() throws MalformedURLException
+ {
+ StringBuffer buffer = new StringBuffer("http://www.google.com/ig/directory?synd=open&output=rss");
+ if (start > 0)
+ {
+ buffer.append("&start=").append(start);
+ }
+ if (num > 0)
+ {
+ buffer.append("&num=").append(num);
+ }
+ if (cat != null)
+ {
+ buffer.append("&cat=").append(cat);
+ }
+ if (q != null)
+ {
+ buffer.append("&q=").append(q);
+ }
+ return new URL(buffer.toString());
+ }
}
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-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResult.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -22,11 +22,9 @@
******************************************************************************/
package org.jboss.portal.widget.google.provider;
-import org.jboss.portal.widget.google.GGWidget;
-
import java.util.List;
import java.util.Iterator;
-import java.util.NoSuchElementException;
+import java.util.ArrayList;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -36,78 +34,21 @@
{
/** . */
- private final GGQuery query;
+ private List entries;
- /** . */
- private List widgetEntries;
-
- GGQueryResult(GGQuery query, List widgetEntries)
+ GGQueryResult(List entries)
{
- if (query == null)
+ if (entries == null)
{
throw new IllegalArgumentException();
}
- if (widgetEntries == null)
- {
- throw new IllegalArgumentException();
- }
- this.query = query;
- this.widgetEntries = widgetEntries;
- }
- public GGQuery getQuery()
- {
- return query;
+ //
+ this.entries = entries;
}
- public Iterator getWidgetIterator()
+ public Iterator entries()
{
- return new WidgetIterator();
+ return entries.iterator();
}
-
- private class WidgetIterator implements Iterator
- {
-
- Iterator iterator = widgetEntries.iterator();
-
- GGWidget next;
-
- public boolean hasNext()
- {
- if (next == null)
- {
- findNext();
- }
- return next != null;
- }
-
- public Object next()
- {
- if (next == null)
- {
- findNext();
- }
- if (next == null)
- {
- throw new NoSuchElementException();
- }
- GGWidget tmp = next;
- next = null;
- return tmp;
- }
-
- void findNext()
- {
- while (iterator.hasNext() && next == null)
- {
- GGProvider.GGWidgetEntry entry = (GGProvider.GGWidgetEntry)iterator.next();
- next = entry.getWidget();
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
}
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-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -23,156 +23,135 @@
package org.jboss.portal.widget.google.provider;
import org.jboss.portal.common.net.URLTools;
+import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.common.io.IOTools;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.HTML;
-import javax.swing.text.MutableAttributeSet;
+import javax.xml.parsers.DocumentBuilderFactory;
import java.net.URL;
import java.net.MalformedURLException;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.StringTokenizer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
import java.util.List;
-import java.io.InputStreamReader;
import java.io.ByteArrayInputStream;
+import java.io.InputStream;
/**
+ * @todo make the timeouts parameterizable
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-class GGQueryResultBuilder
+public class GGQueryResultBuilder
{
/** . */
- private final GGQuery query;
+ public static final String GHAPI_URI = "http://www.google.com/apis/homepage";
- public GGQueryResultBuilder(GGQuery query)
+ /** . */
+ private final URL url;
+
+ public GGQueryResultBuilder(GGQuery query) throws MalformedURLException
{
if (query == null)
{
throw new IllegalArgumentException();
}
- this.query = query;
+ this.url = query.buildQueryURL();
}
- private URL getURLQuery() throws MalformedURLException
+
+ public GGQueryResultBuilder(URL url)
{
- StringBuffer buffer = new StringBuffer("http://www.google.com/ig/directory?synd=open");
- if (query.getStart() > 0)
+ if (url == null)
{
- buffer.append("&start=").append(query.getStart());
+ throw new IllegalArgumentException();
}
- if (query.getNum() > 0)
- {
- buffer.append("&num=").append(query.getNum());
- }
- if (query.getCat() != null)
- {
- buffer.append("&cat=").append(query.getCat());
- }
- if (query.getQ() != null)
- {
- buffer.append("&q=").append(query.getQ());
- }
- return new URL(buffer.toString());
+ this.url = url;
}
- public GGQueryResult build(GGProvider.Context context)
+ public GGQueryResult build()
{
try
{
- // Find widget URLs
- URL url = getURLQuery() ;
-
// Read fully the URL content first
- // log.info("Retrieving " + url);
- byte[] bytes = URLTools.performGET(url, 5000, 5000);
+ byte[] bytes;
+ if ("http".equals(url.getProtocol()))
+ {
+ bytes = URLTools.performGET(url, 5000, 5000);
+ }
+ else
+ {
+ InputStream in = url.openStream();
+ try
+ {
+ bytes = IOTools.getBytes(in);
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ }
+
+ //
if (bytes == null)
{
throw new Exception("Cannot retrieve " + url);
}
- // log.info("Document " + url + " has been retrieved");
//
- final LinkedHashSet urls = new LinkedHashSet();
- HTMLEditorKit.ParserCallback callback = new HTMLEditorKit.ParserCallback()
- {
- public void handleStartTag(HTML.Tag t, MutableAttributeSet attrSet, int pos)
- {
- if (t == HTML.Tag.A)
- {
- try
- {
- String href = (String)attrSet.getAttribute(HTML.Attribute.HREF);
- URL url = new URL(href);
- String query = url.getQuery();
- if (query != null)
- {
- Map params = new HashMap();
- StringTokenizer st = new StringTokenizer(query, "&");
- while (st.hasMoreTokens())
- {
- String pair = st.nextToken();
- int separator = pair.indexOf('=');
- if (separator != -1)
- {
- String left = pair.substring(0, separator);
- String right = pair.substring(separator + 1);
- params.put(left, right);
- }
- }
+ DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
+ factory.setNamespaceAware(true);
- //
- if (params.containsKey("url"))
- {
- String tmp = (String)params.get("url");
- if (tmp.endsWith(".xml"))
- {
- url = new URL(tmp);
- urls.add(url);
- }
- }
- }
- }
- catch (MalformedURLException ignore)
- {
- }
- }
- }
- };
- HTMLEditorKit.Parser parser = new ParserAccessor().getParser();
- parser.parse(new InputStreamReader(new ByteArrayInputStream(bytes), "UTF-8"), callback, true);
+ //
+ Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(bytes));
- // Now parse each
- List widgetEntries = new ArrayList(urls.size());
- for (Iterator i = urls.iterator();i.hasNext();)
+ //
+ Element rssElt = doc.getDocumentElement();
+ Element channelElt = XMLTools.getUniqueChild(rssElt, "channel", true);
+
+ //
+ List entries = new ArrayList();
+ for (Iterator i = XMLTools.getChildrenIterator(channelElt, "item");i.hasNext();)
{
- URL widgetURL = (URL)i.next();
- GGProvider.GGWidgetEntry entry = context.getWidgetEntry(widgetURL);
- widgetEntries.add(entry);
+ Element itemElt = (Element)i.next();
+
+ //
+ Element titleElt = XMLTools.getUniqueChild(itemElt, "title", true);
+ Element linkElt = XMLTools.getUniqueChild(itemElt, "link", true);
+ Element descriptionElt = XMLTools.getUniqueChild(itemElt, "description", true);
+ Element authorElt = XMLTools.getUniqueChild(itemElt, "author", false);
+ Element screenshotElt = XMLTools.getUniqueChild(itemElt, GHAPI_URI, "screenshot", true);
+ Element thumbnailElt = XMLTools.getUniqueChild(itemElt, GHAPI_URI, "thumbnail", true);
+ Element widthElt = XMLTools.getUniqueChild(itemElt, GHAPI_URI, "width", true);
+ Element heightElt = XMLTools.getUniqueChild(itemElt, GHAPI_URI, "height", true);
+
+ //
+ String title = XMLTools.asString(titleElt);
+ URL link = new URL(XMLTools.asString(linkElt));
+ String description = XMLTools.asString(descriptionElt);
+ String screenshot = XMLTools.asString(screenshotElt);
+ String thumbnail = XMLTools.asString(thumbnailElt);
+ String author = authorElt != null ? XMLTools.asString(authorElt) : "";
+ int width = Integer.parseInt(XMLTools.asString(widthElt));
+ int height = Integer.parseInt(XMLTools.asString(heightElt));
+
+ //
+ GGQueryResultEntry entry = new GGQueryResultEntry(link, title, description, screenshot, thumbnail, author, width, height);
+ entries.add(entry);
}
//
- return new GGQueryResult(query, widgetEntries);
+ return new GGQueryResult(entries);
}
catch (Exception e)
{
e.printStackTrace();
}
- return new GGQueryResult(query, Collections.EMPTY_LIST);
+ //
+ return new GGQueryResult(Collections.EMPTY_LIST);
}
-
- private static class ParserAccessor extends HTMLEditorKit
- {
- public Parser getParser()
- {
- return super.getParser();
- }
- }
-
}
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultEntry.java (from rev 7678, trunk/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 (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultEntry.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * 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.google.provider;
+
+import java.net.URL;
+
+/**
+ * @todo parse all meta data
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GGQueryResultEntry
+{
+
+ /** . */
+ private final URL url;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String description;
+
+ /** . */
+ private final String screenshot;
+
+ /** . */
+ private final String thumbnail;
+
+ /** . */
+ private final String author;
+
+ /** . */
+ private final int width;
+
+ /** . */
+ private final int height;
+
+ public GGQueryResultEntry(
+ URL url,
+ String title,
+ String description,
+ String screenshot,
+ String thumbnail,
+ String author,
+ int width,
+ int height)
+ {
+ this.url = url;
+ this.title = title;
+ this.description = description;
+ this.screenshot = screenshot;
+ this.thumbnail = thumbnail;
+ this.author = author;
+ this.width = width;
+ this.height = height;
+ }
+
+ public URL getURL()
+ {
+ return url;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public String getScreenshot()
+ {
+ return screenshot;
+ }
+
+ public String getThumbnail()
+ {
+ return thumbnail;
+ }
+
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ public int getWidth()
+ {
+ return width;
+ }
+
+ public int getHeight()
+ {
+ return height;
+ }
+}
Deleted: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetBuilder.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -1,208 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.widget.google.provider;
-
-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.common.concurrent.loader.ObjectLoader;
-import org.jboss.portal.widget.google.type.DataType;
-import org.jboss.portal.widget.google.type.StringType;
-import org.jboss.portal.widget.google.type.LocationType;
-import org.jboss.portal.widget.google.type.HiddenType;
-import org.jboss.portal.widget.google.type.BoolType;
-import org.jboss.portal.widget.google.type.ListType;
-import org.jboss.portal.widget.google.type.EnumType;
-import org.jboss.portal.widget.google.GGWidget;
-import org.jboss.portal.widget.google.GGPreferenceInfo;
-import org.jboss.portal.widget.google.GGPreferencesInfo;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.DocumentBuilder;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.io.ByteArrayInputStream;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class GGWidgetBuilder implements ObjectLoader
-{
-
- /** . */
- private final URL url;
-
- public GGWidgetBuilder(URL url)
- {
- if (url == null)
- {
- throw new IllegalArgumentException("No null URL");
- }
- this.url = url;
- }
-
- public URL getURL()
- {
- return url;
- }
-
-
- public Object load()
- {
- try
- {
- return create();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-
- //
- return null;
- }
- }
-
- public GGWidget create() throws Exception
- {
- DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
- DocumentBuilder builder = factory.newDocumentBuilder();
- byte[] bytes = obtainWidget(url);
- if (bytes == null)
- {
- throw new Exception("Cannot retrieve document " + url);
- }
- Document doc = builder.parse(new ByteArrayInputStream(bytes));
- Element moduleElt = doc.getDocumentElement();
-
- //
- Collection tmp = null;
- Iterator userPrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "UserPref");
- while (userPrefsEltIterator.hasNext())
- {
- Element userPref = (Element)userPrefsEltIterator.next();
- String nameAttr = userPref.getAttribute("name");
- String displayNameAttr = userPref.getAttribute("display_name");
- String urlParamAttr = userPref.getAttribute("urlparam");
- String dataTypeAttr = userPref.getAttribute("datatype");
- String requiredAttr = userPref.getAttribute("required");
- String defaultValueAttr = userPref.getAttribute("default_value");
-
- // We don't support that for now
- if (urlParamAttr.length() > 0)
- {
- throw new Exception();
- }
-
- // String is default type when not specified
- DataType dataType = StringType.getInstance();
- if (dataTypeAttr.length() > 0)
- {
- int dataTypeOrdinal = DataType.parseDataTypeLiteral(dataTypeAttr);
- switch(dataTypeOrdinal)
- {
- case DataType.HIDDEN:
- dataType = HiddenType.getInstance();
- break;
- case DataType.BOOL:
- dataType = BoolType.getInstance();
- break;
- case DataType.STRING:
- dataType = StringType.getInstance();
- break;
- case DataType.LIST:
- dataType = ListType.getInstance();
- break;
- case DataType.ENUM:
- Collection values = new ArrayList();
- for (Iterator i = XMLTools.getChildrenIterator(userPref, "EnumValue");i.hasNext();)
- {
- Element enumValueElt = (Element)i.next();
- String valueAttr = enumValueElt.getAttribute("value");
- String displayValueAttr = enumValueElt.getAttribute("display_value");
- EnumType.Value value = new EnumType.Value(valueAttr, displayValueAttr.length() > 0 ? displayValueAttr : null);
- values.add(value);
- }
- dataType = new EnumType(values);
- break;
- case DataType.LOCATION:
- dataType = LocationType.getInstance();
- break;
- }
- }
-
- //
- GGPreferenceInfo prefInfo = new GGPreferenceInfo(
- nameAttr,
- dataType,
- displayNameAttr.length() > 0 ? displayNameAttr : null,
- requiredAttr.length() > 0 ? Boolean.valueOf(requiredAttr).booleanValue() : false,
- defaultValueAttr.length() > 0 ? defaultValueAttr : null
- );
-
- //
- if (tmp == null)
- {
- tmp = new ArrayList();
- }
- tmp.add(prefInfo);
- }
- GGPreferencesInfo prefsInfo = GGPreferencesInfo.EMPTY_PREFS;
- if (tmp != null)
- {
- prefsInfo = new GGPreferencesInfo(tmp);
- }
-
- //
- Iterator modulePrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "ModulePrefs");
- if (modulePrefsEltIterator.hasNext())
- {
- Element modulePrefsElt = (Element)modulePrefsEltIterator.next();
- String titleAttr = modulePrefsElt.getAttribute("title");
- String descriptionAttr = modulePrefsElt.getAttribute("description");
- String widthAttr = modulePrefsElt.getAttribute("width");
- String heightAttr = modulePrefsElt.getAttribute("height");
-
- //
- LocalizedString title = titleAttr != null ? new LocalizedString(titleAttr, Locale.ENGLISH) : null;
- LocalizedString description = descriptionAttr != null ? new LocalizedString(descriptionAttr, Locale.ENGLISH) : null;
- int width = (widthAttr != null && widthAttr.length() > 0) ? Integer.parseInt(widthAttr) : 320;
- int height = (heightAttr != null && heightAttr.length() > 0) ? Integer.parseInt(heightAttr) : 200;
- return new GGWidget(url.toString(), prefsInfo, title, description, width, height);
- }
- else
- {
- throw new Exception(); // Basic for now
- }
- }
-
- protected byte[] obtainWidget(URL url) throws Exception
- {
- return URLTools.performGET(url, 5000, 5000);
- }
-}
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java (from rev 7678, trunk/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 (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java 2007-07-06 14:31:35 UTC (rev 7686)
@@ -0,0 +1,203 @@
+/******************************************************************************
+ * 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.google.provider;
+
+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.google.type.DataType;
+import org.jboss.portal.widget.google.type.StringType;
+import org.jboss.portal.widget.google.type.LocationType;
+import org.jboss.portal.widget.google.type.HiddenType;
+import org.jboss.portal.widget.google.type.BoolType;
+import org.jboss.portal.widget.google.type.ListType;
+import org.jboss.portal.widget.google.type.EnumType;
+import org.jboss.portal.widget.google.GGPreferenceInfo;
+import org.jboss.portal.widget.google.GGPreferencesInfo;
+import org.jboss.portal.widget.google.GGWidgetInfo;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.io.ByteArrayInputStream;
+
+/**
+ * Build widget meta data from its URL.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class GGWidgetInfoBuilder
+{
+
+ /** . */
+ private final URL url;
+
+ public GGWidgetInfoBuilder(URL url)
+ {
+ if (url == null)
+ {
+ throw new IllegalArgumentException("No null URL");
+ }
+
+ //
+ this.url = url;
+ }
+
+ public URL getURL()
+ {
+ return url;
+ }
+
+ /**
+ * Build the widget info from the url or return null if it is not possible.
+ * @return the widget info
+ * @throws Exception
+ */
+ public GGWidgetInfo create() throws Exception
+ {
+ byte[] bytes = obtainWidget(url);
+
+ // No response was obtained
+ if (bytes == null)
+ {
+ return null;
+ }
+
+ //
+ DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(new ByteArrayInputStream(bytes));
+ Element moduleElt = doc.getDocumentElement();
+
+ //
+ Collection tmp = null;
+ Iterator userPrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "UserPref");
+ while (userPrefsEltIterator.hasNext())
+ {
+ Element userPref = (Element)userPrefsEltIterator.next();
+ String nameAttr = userPref.getAttribute("name");
+ String displayNameAttr = userPref.getAttribute("display_name");
+ String urlParamAttr = userPref.getAttribute("urlparam");
+ String dataTypeAttr = userPref.getAttribute("datatype");
+ String requiredAttr = userPref.getAttribute("required");
+ String defaultValueAttr = userPref.getAttribute("default_value");
+
+ // We don't support that for now
+ if (urlParamAttr.length() > 0)
+ {
+ throw new Exception();
+ }
+
+ // String is default type when not specified
+ DataType dataType = StringType.getInstance();
+ if (dataTypeAttr.length() > 0)
+ {
+ int dataTypeOrdinal = DataType.parseDataTypeLiteral(dataTypeAttr);
+ switch(dataTypeOrdinal)
+ {
+ case DataType.HIDDEN:
+ dataType = HiddenType.getInstance();
+ break;
+ case DataType.BOOL:
+ dataType = BoolType.getInstance();
+ break;
+ case DataType.STRING:
+ dataType = StringType.getInstance();
+ break;
+ case DataType.LIST:
+ dataType = ListType.getInstance();
+ break;
+ case DataType.ENUM:
+ Collection values = new ArrayList();
+ for (Iterator i = XMLTools.getChildrenIterator(userPref, "EnumValue");i.hasNext();)
+ {
+ Element enumValueElt = (Element)i.next();
+ String valueAttr = enumValueElt.getAttribute("value");
+ String displayValueAttr = enumValueElt.getAttribute("display_value");
+ EnumType.Value value = new EnumType.Value(valueAttr, displayValueAttr.length() > 0 ? displayValueAttr : null);
+ values.add(value);
+ }
+ dataType = new EnumType(values);
+ break;
+ case DataType.LOCATION:
+ dataType = LocationType.getInstance();
+ break;
+ }
+ }
+
+ //
+ GGPreferenceInfo prefInfo = new GGPreferenceInfo(
+ nameAttr,
+ dataType,
+ displayNameAttr.length() > 0 ? displayNameAttr : null,
+ requiredAttr.length() > 0 ? Boolean.valueOf(requiredAttr).booleanValue() : false,
+ defaultValueAttr.length() > 0 ? defaultValueAttr : null
+ );
+
+ //
+ if (tmp == null)
+ {
+ tmp = new ArrayList();
+ }
+ tmp.add(prefInfo);
+ }
+ GGPreferencesInfo prefsInfo = GGPreferencesInfo.EMPTY_PREFS;
+ if (tmp != null)
+ {
+ prefsInfo = new GGPreferencesInfo(tmp);
+ }
+
+ Iterator modulePrefsEltIterator = XMLTools.getChildrenIterator(moduleElt, "ModulePrefs");
+ if (modulePrefsEltIterator.hasNext())
+ {
+ Element modulePrefsElt = (Element)modulePrefsEltIterator.next();
+ String titleAttr = modulePrefsElt.getAttribute("title");
+ String descriptionAttr = modulePrefsElt.getAttribute("description");
+ String widthAttr = modulePrefsElt.getAttribute("width");
+ String heightAttr = modulePrefsElt.getAttribute("height");
+
+ //
+ LocalizedString title = titleAttr != null ? new LocalizedString(titleAttr, Locale.ENGLISH) : null;
+ LocalizedString description = descriptionAttr != null ? new LocalizedString(descriptionAttr, Locale.ENGLISH) : null;
+ int width = (widthAttr != null && widthAttr.length() > 0) ? Integer.parseInt(widthAttr) : 320;
+ int height = (heightAttr != null && heightAttr.length() > 0) ? Integer.parseInt(heightAttr) : 200;
+ return new GGWidgetInfo(title, description, width, height, prefsInfo);
+ }
+ else
+ {
+ throw new Exception(); // Basic for now
+ }
+ }
+
+ protected byte[] obtainWidget(URL url) throws Exception
+ {
+ return URLTools.performGET(url, 5000, 5000);
+ }
+}
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/google/queryresult1.xml (from rev 7678, trunk/widget/src/resources/test/google/queryresult1.xml)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/google/queryresult1.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/test/google/queryresult1.xml 2007-07-06 14:31:35 UTC (rev 7686)
@@ -0,0 +1,429 @@
+<rss version="2.0"
+xmlns="http://backend.userland.com/rss2"
+xmlns:ghapi="http://www.google.com/apis/homepage">
+<channel>
+<title>Homepage Content</title>
+<link>http://www.google.com/ig/</link>
+<image>http://www.google.com/ig/images/igoogle_logo_sm.gif</image>
+<description>Homepage Content search results.</description>
+<language>en</language>
+<copyright>Copyright 2007 and onwards Google, Inc.</copyright>
+<!-- number of items total, the actual items are affected by pagination --><ghapi:num_items>9939</ghapi:num_items>
+<ghapi:search_example>e.g. calendar, Dilbert, Washington Post</ghapi:search_example>
+<ghapi:weekly_pageviews_info>Gadget pageview statistics are approximate only-- for precise statistics, we recommend the use of Google Analytics inside your gadgets. Gadget pageviews represent the actual number of times that the gadget was rendered, including Google Personalized Homepage, Google Pages, Google Desktop and across thousands of independent pages around the web.</ghapi:weekly_pageviews_info>
+<item>
+<title>Date & Time</title>
+<link>http://www.google.com/ig/modules/datetime.xml</link>
+<guid>http://www.google.com/ig/modules/datetime.xml</guid>
+<description>Add a clock to your page. Click edit to change it to the color of your choice.</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/datetime.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/datetime-thm.png</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<author>matt.feedback+datetime(a)gmail.com</author>
+<ghapi:author_name>Matt M.</ghapi:author_name>
+<ghapi:author_location>Mountain View, CA</ghapi:author_location>
+<ghapi:author_affiliation>Google Inc.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>true</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>136</ghapi:height>
+<ghapi:num_userprefs>1</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>175740286</ghapi:weekly_pageviews></item><item>
+<title>Search YouTube</title>
+<link>http://throttled.org/googlegadgets/youtubesearch.xml</link>
+<guid>http://throttled.org/googlegadgets/youtubesearch.xml</guid>
+<description>A search module, which searches YouTube by tags.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2>funandgames</ghapi:category2>
+<author>ewilliams1(a)gmail.com</author>
+<ghapi:author_name>Eddie Williams</ghapi:author_name>
+<ghapi:author_location>Arizona</ghapi:author_location>
+<ghapi:author_affiliation>eddiewilliams.org</ghapi:author_affiliation>
+<ghapi:author_photo>/ig/cache/28/a3/28a39282258f1ba32b6f6468ae6d12bc-author.png</ghapi:author_photo>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>200</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>11928552</ghapi:weekly_pageviews></item><item>
+<title>PacMan v2.4</title>
+<link>http://www.schulz.dk/pacman.xml</link>
+<guid>http://www.schulz.dk/pacman.xml</guid>
+<description>The good old Pacman game. Instructions: Use the arrow keys to guide Pac-Man. P - Pause/unpause game Q - Quit game M - Mute/unmute sound L - Low quality on/off</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/ov/module_pacman_full.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/ov/module_pacman.png</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<author>kimusan(a)gmail.com</author>
+<ghapi:author_name>Kim Schulz.</ghapi:author_name>
+<ghapi:author_location>Aalborg, Denmark</ghapi:author_location>
+<ghapi:author_affiliation>Opensource world.</ghapi:author_affiliation>
+<ghapi:author_photo>/ig/cache/8f/2a/8f2aa11b287f5072ff77bc19e66ff78f-author.png</ghapi:author_photo>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>420</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>7248983</ghapi:weekly_pageviews></item><item>
+<title>Bowling</title>
+<link>http://googlegadgets.neoteksystems.com/bowlinggadget.xml</link>
+<guid>http://googlegadgets.neoteksystems.com/bowlinggadget.xml</guid>
+<description>With a little practice you be knocking down pins like the pros with this cool game.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/60/a2/60a251befa8f2eceb1dd877b29a7c685.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/60/a2/60a251befa8f2eceb1dd877b29a7c685-thm...</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<author>googleGadgets(at)neoteksystems.com</author>
+<ghapi:author_name>NeoTekSystems</ghapi:author_name>
+<ghapi:author_location>Greer, SC</ghapi:author_location>
+<ghapi:author_affiliation>NeoTekSystems</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>500</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>451998</ghapi:weekly_pageviews></item><item>
+<title>Fitness Tip of the Day</title>
+<link>http://phillip132.googlepages.com/fitness.xml</link>
+<guid>http://phillip132.googlepages.com/fitness.xml</guid>
+<description>Daily tips and quotes about fitness and exercise.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/c2/5d/c25dc64c96b128a50c313cb3ddf20be4.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/c2/5d/c25dc64c96b128a50c313cb3ddf20be4-thm...</ghapi:thumbnail>
+<ghapi:category>lifestyle</ghapi:category>
+<ghapi:category2>communication</ghapi:category2>
+<author>phillip132(a)gmail.com</author>
+<ghapi:author_name>Phillip Olsen</ghapi:author_name>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>140</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>1594201</ghapi:weekly_pageviews></item><item>
+<title>myWeather</title>
+<link>http://www.notkewl.com/myWeather/myWeather.xml</link>
+<guid>http://www.notkewl.com/myWeather/myWeather.xml</guid>
+<description>View the weather for your area! Just enter your zip code / location code for international cities (click the gadget title to go to the page to use the location code lookup) and choose the unit. 3 Day + Detailed forecast for each day. Enjoy this stylish obnocktious design. Gets weather information f...</description>
+<ghapi:screenshot>http://www.google.com/ig/images/no_preview.gif</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/images/no_image/en_ALL.gif</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2>news</ghapi:category2>
+<author>info(a)notkewl.com</author>
+<ghapi:author_name>Jani Lehti</ghapi:author_name>
+<ghapi:author_location>Flower Mound, TX</ghapi:author_location>
+<ghapi:author_affiliation>None</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>280</ghapi:width>
+<ghapi:height>250</ghapi:height>
+<ghapi:num_userprefs>2</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>872154</ghapi:weekly_pageviews></item><item>
+<title>MP3 Player</title>
+<link>http://mike.s.duffy.googlepages.com/mp3player.xml</link>
+<guid>http://mike.s.duffy.googlepages.com/mp3player.xml</guid>
+<description>A simple, elegant flash MP3 player from ODEO. Use the edit menu to enter the URL of the MP3 file you wish to listen to.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/44/13/44135cfdb83465944f63f794f875d0c0.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/44/13/44135cfdb83465944f63f794f875d0c0-thm...</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>mike.s.duffy+gadget_feedback(a)gmail.com</author>
+<ghapi:author_name>Mike Duffy</ghapi:author_name>
+<ghapi:author_location>Davis, CA</ghapi:author_location>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>50</ghapi:height>
+<ghapi:num_userprefs>1</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>159032</ghapi:weekly_pageviews></item><item>
+<title>Google Talk</title>
+<link>http://www.google.com/ig/modules/googletalk.xml</link>
+<guid>http://www.google.com/ig/modules/googletalk.xml</guid>
+<description>See your contacts and send instant messages.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/46/44/464445ab3ca9500a5558fdc7d7051365.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/46/44/464445ab3ca9500a5558fdc7d7051365-thm...</ghapi:thumbnail>
+<ghapi:category>communication</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<ghapi:author_name>Google Talk Team</ghapi:author_name>
+<ghapi:author_location>Kirkland, WA</ghapi:author_location>
+<ghapi:author_affiliation>Google, Inc.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>true</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>451</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>3710027</ghapi:weekly_pageviews></item><item>
+<title>Mini Web</title>
+<link>http://blog.outer-court.com/homepage/miniweb.xml</link>
+<guid>http://blog.outer-court.com/homepage/miniweb.xml</guid>
+<description>Displays a mini search which results in mini websites to be read on the personalized homepage. This module uses (or abuses) the Google Mobile search service.</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/ov/module_miniweb_full.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/ov/module_miniweb.png</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<author>philipp.lenssen+widget(a)gmail.com</author>
+<ghapi:author_name>Philipp Lenssen</ghapi:author_name>
+<ghapi:author_location>Stuttgart, Germany</ghapi:author_location>
+<ghapi:author_affiliation>Google Blogoscoped</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>190</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>22504</ghapi:weekly_pageviews></item><item>
+<title>Google Docs & Spreadsheets</title>
+<link>http://www.google.com/ig/modules/docs.xml</link>
+<guid>http://www.google.com/ig/modules/docs.xml</guid>
+<description>View your active Google documents and spreadsheets</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/docs.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/docs-thm.png</ghapi:thumbnail>
+<ghapi:category>communication</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>claudiac.feedback+docs(a)gmail.com</author>
+<ghapi:author_name>Claudia C.</ghapi:author_name>
+<ghapi:author_location>Mountain View, CA</ghapi:author_location>
+<ghapi:author_affiliation>Google Inc.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>true</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>50</ghapi:height>
+<ghapi:num_userprefs>2</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>4296863</ghapi:weekly_pageviews></item><item>
+<title>Google Calendar Viewer</title>
+<link>http://ralph.feedback.googlepages.com/googlecalendarviewer.xml</link>
+<guid>http://ralph.feedback.googlepages.com/googlecalendarviewer.xml</guid>
+<description>Google Calendar Viewer</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/8e/13/8e13d2ff945a0d45c66ff8665e017eab.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/8e/13/8e13d2ff945a0d45c66ff8665e017eab-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<author>ralph.feedback+googlecalendarviewer(a)gmail.com</author>
+<ghapi:author_name>Alex Sherwin, Eugen Kremer, Ralph S.</ghapi:author_name>
+<ghapi:author_location>Brighton, MI</ghapi:author_location>
+<ghapi:author_affiliation>Google Inc.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>200</ghapi:height>
+<ghapi:num_userprefs>4</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>1863052</ghapi:weekly_pageviews></item><item>
+<title>World Clocks</title>
+<link>http://www.ljmsite.com/google/gadgets/worldclocks.xml</link>
+<guid>http://www.ljmsite.com/google/gadgets/worldclocks.xml</guid>
+<description>Gadget for your Google homepage or website that displays multiple analog or digital clocks at the times in the selected time zones or countries/cities. The clocks can be synchronized with our server to always display the correct times. This gadget is especially useful when working with Globally Disp...</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/38/24/382452f1075b88ce7e71312ce9b66329.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/38/24/382452f1075b88ce7e71312ce9b66329-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<author>worldclocks_feedback(a)ljmsite.com</author>
+<ghapi:author_name>Jerome Mouton</ghapi:author_name>
+<ghapi:author_location>Huntsville, AL, USA</ghapi:author_location>
+<ghapi:author_affiliation>None</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>300</ghapi:height>
+<ghapi:num_userprefs>26</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>3865626</ghapi:weekly_pageviews></item><item>
+<title>YouTube Player</title>
+<link>http://padmanijain.googlepages.com/1YTP_6.xml</link>
+<guid>http://padmanijain.googlepages.com/1YTP_6.xml</guid>
+<description>You can search, play and download YouTube videos on your webpage.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/10/a4/10a4db9d35393ca04c34474dbae6290a.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/10/a4/10a4db9d35393ca04c34474dbae6290a-thm...</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>vi_ja(a)hotmail.com</author>
+<ghapi:author_name>Vineet Jain</ghapi:author_name>
+<ghapi:author_location>Ottawa, ON, Canada.</ghapi:author_location>
+<ghapi:author_affiliation>Cisco Systems.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>220</ghapi:width>
+<ghapi:height>330</ghapi:height>
+<ghapi:num_userprefs>2</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>85715</ghapi:weekly_pageviews></item><item>
+<title>Google Calendar</title>
+<link>http://www.google.com/ig/modules/calendar-for-your-site.xml</link>
+<guid>http://www.google.com/ig/modules/calendar-for-your-site.xml</guid>
+<description>Google Calendar for your site, webpage or blog</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/calendar.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/calendar-thm.png</ghapi:thumbnail>
+<ghapi:category>communication</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>michael.feedback(a)gmail.com</author>
+<ghapi:author_name>Michael B.</ghapi:author_name>
+<ghapi:author_location>Palo Alto, CA</ghapi:author_location>
+<ghapi:author_affiliation>Google Inc.</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>true</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>450</ghapi:height>
+<ghapi:num_userprefs>19</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>524170</ghapi:weekly_pageviews></item><item>
+<title>The Weather Channel</title>
+<link>http://gadgets.weather.com/services/gadgets/googlegadget/gadget.xml</link>
+<guid>http://gadgets.weather.com/services/gadgets/googlegadget/gadget.xml</guid>
+<description>The Weather Channel Google Gadget provides local weather forecasts based upon city or US Zip Code</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/da/c4/dac4011be823372e081fda0bbd81d470.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/da/c4/dac4011be823372e081fda0bbd81d470-thm...</ghapi:thumbnail>
+<ghapi:category>news</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>googlegadget(a)talk2.weather.com</author>
+<ghapi:author_name>The Weather Channel</ghapi:author_name>
+<ghapi:author_affiliation>The Weather Channel Interactive</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>380</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>1129521</ghapi:weekly_pageviews></item><item>
+<title>Music Box</title>
+<link>http://widget4u.googlepages.com/gmusicbox.xml</link>
+<guid>http://widget4u.googlepages.com/gmusicbox.xml</guid>
+<description>a Music Box which you can add music</description>
+<ghapi:screenshot>http://www.google.com/ig/images/no_preview.gif</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/images/no_image/en_ALL.gif</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2>funandgames</ghapi:category2>
+<author>steven4u(a)gmailo.com</author>
+<ghapi:author_name>Steven</ghapi:author_name>
+<ghapi:author_location>Macau</ghapi:author_location>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>150</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>8994</ghapi:weekly_pageviews></item><item>
+<title>Microsoft Outlook</title>
+<link>http://andyast.googlepages.com/MSOutlookWidget.xml</link>
+<guid>http://andyast.googlepages.com/MSOutlookWidget.xml</guid>
+<description>MS Outlook Inbox and Calendar</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/1d/04/1d04b237d695e00f7345d8b32deda210.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/1d/04/1d04b237d695e00f7345d8b32deda210-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<author>andyast(a)gmail.com</author>
+<ghapi:author_name>Andy Steinmann</ghapi:author_name>
+<ghapi:author_location>Nixa, MO</ghapi:author_location>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>400</ghapi:width>
+<ghapi:height>600</ghapi:height>
+<ghapi:num_userprefs>1</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>365631</ghapi:weekly_pageviews></item><item>
+<title>Mario is Back!</title>
+<link>http://homepagegadgets.googlepages.com/mario.xml</link>
+<guid>http://homepagegadgets.googlepages.com/mario.xml</guid>
+<description>The most played game ever - Mario is Back! Add to your homepage now and get back to classic arcade action...</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/4d/6b/4d6bf0c2f809d2301c0f708f8dc9596d.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/4d/6b/4d6bf0c2f809d2301c0f708f8dc9596d-thm...</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<author>bijoy(a)jsplash.com</author>
+<ghapi:author_name>Bijoy Thangaraj</ghapi:author_name>
+<ghapi:author_location>Trivandrum, Kerala, India</ghapi:author_location>
+<ghapi:author_affiliation>None</ghapi:author_affiliation>
+<ghapi:author_photo>/ig/cache/4d/6b/4d6bf0c2f809d2301c0f708f8dc9596d-author.png</ghapi:author_photo>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>200</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>1198197</ghapi:weekly_pageviews></item><item>
+<title>Yahoo! Messenger</title>
+<link>http://whizzgadgets.googlepages.com/yahoo.xml</link>
+<guid>http://whizzgadgets.googlepages.com/yahoo.xml</guid>
+<description>Chat with your Yahoo! buddies anywhere, anytime. All you need is your personalized homepage.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/d9/75/d975f79b14a9d2ad5f1038a231d86362.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/d9/75/d975f79b14a9d2ad5f1038a231d86362-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2>communication</ghapi:category2>
+<author>grenardus(a)gmail.com</author>
+<ghapi:author_name>Whizz</ghapi:author_name>
+<ghapi:author_location>The Netherlands</ghapi:author_location>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>400</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>151198</ghapi:weekly_pageviews></item><item>
+<title>Weather by Weather.com</title>
+<link>http://timcwebman.googlepages.com/weather.xml</link>
+<guid>http://timcwebman.googlepages.com/weather.xml</guid>
+<description>This module is designed to give you the weather as Weather.com reports it. Enter your zip code (required), choose your unit of measure, pick from the list of available styles, and display either vertically (nice for small resolutions) or horizontally (default). This module currently only works fo...</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/46/63/46631770b202d7d4f6cf46d3f3650394.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/46/63/46631770b202d7d4f6cf46d3f3650394-thm...</ghapi:thumbnail>
+<ghapi:category>news</ghapi:category>
+<author>timcwebman(a)gmail.com</author>
+<ghapi:author_name>Tim</ghapi:author_name>
+<ghapi:author_location>Lawrence, KS</ghapi:author_location>
+<ghapi:author_affiliation>None</ghapi:author_affiliation>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>180</ghapi:height>
+<ghapi:num_userprefs>4</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>666303</ghapi:weekly_pageviews></item><item>
+<title>Laszlo ClockBlox</title>
+<link>http://www.openlaszlo.org/apps/clockblox.xml</link>
+<guid>http://www.openlaszlo.org/apps/clockblox.xml</guid>
+<description>a small clock written using Laszlo's LZX language</description>
+<ghapi:screenshot>http://www.google.com/ig/modules/ov/module_laszloclock_full.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/modules/ov/module_laszloclock.png</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2></ghapi:category2>
+<author>enw(a)laszlosystems.com</author>
+<ghapi:author_name>Elliot Winard</ghapi:author_name>
+<ghapi:author_location>San Francisco, CA</ghapi:author_location>
+<ghapi:author_affiliation>Laszlo Systems, Inc.</ghapi:author_affiliation>
+<ghapi:author_photo>/ig/modules/ov/developer_elliot.jpg</ghapi:author_photo>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>150</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>575022</ghapi:weekly_pageviews></item><item>
+<title>Spider</title>
+<link>http://abowman.googlepages.com/spider.xml</link>
+<guid>http://abowman.googlepages.com/spider.xml</guid>
+<description>Add this spider to your page and watch it crawl around and follow your mouse. The latest update added more realism to the spider and allows you to change its color, size, and speed. You can also add an image behind the spider.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/df/7f/df7fc65a0a97e3365af350f8f6a58c3f.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/df/7f/df7fc65a0a97e3365af350f8f6a58c3f-thm...</ghapi:thumbnail>
+<ghapi:category>funandgames</ghapi:category>
+<author>adbocode(a)gmail.com</author>
+<ghapi:author_name>Adam Bowman</ghapi:author_name>
+<ghapi:author_location>Hallowell, Maine</ghapi:author_location>
+<ghapi:author_photo>/ig/cache/df/7f/df7fc65a0a97e3365af350f8f6a58c3f-author.png</ghapi:author_photo>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>200</ghapi:height>
+<ghapi:num_userprefs>13</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>864280</ghapi:weekly_pageviews></item><item>
+<title>Micro-TV</title>
+<link>http://www.cammap.net/tvlive/microtv.xml</link>
+<guid>http://www.cammap.net/tvlive/microtv.xml</guid>
+<description>Watch live international TV channels</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/ce/4f/ce4fc514cce72178f072bc781fc245ca.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/ce/4f/ce4fc514cce72178f072bc781fc245ca-thm...</ghapi:thumbnail>
+<ghapi:category>lifestyle</ghapi:category>
+<ghapi:category2>tools</ghapi:category2>
+<author>only_serious_mail_can_be_sent_to_info(a)cammap.net</author>
+<ghapi:author_name>CamMap.net</ghapi:author_name>
+<ghapi:author_location>Amsterdam, Netherlands</ghapi:author_location>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>160</ghapi:width>
+<ghapi:height>160</ghapi:height>
+<ghapi:num_userprefs>1</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>17854</ghapi:weekly_pageviews></item><item>
+<title>Mini-Clock</title>
+<link>http://www.labpixies.com/campaigns/clock/mini_clock.xml</link>
+<guid>http://www.labpixies.com/campaigns/clock/mini_clock.xml</guid>
+<description>Mini-Clock, the coolest clock for your homepage, now mini-sized! Click the gallery button to select your favorite skin. Make your homepage come alive with our cool selection of skins, see the date and time with style.</description>
+<ghapi:screenshot>http://www.google.com/ig/cache/f4/c1/f4c1fcb3fa9dd6a01fc0cf2910f497b9.png</ghapi:screenshot>
+<ghapi:thumbnail>http://www.google.com/ig/cache/f4/c1/f4c1fcb3fa9dd6a01fc0cf2910f497b9-thm...</ghapi:thumbnail>
+<ghapi:category>tools</ghapi:category>
+<ghapi:category2>funandgames</ghapi:category2>
+<author>info+mini_clock(a)labpixies.com</author>
+<ghapi:author_name>LabPixies</ghapi:author_name>
+<ghapi:type>ghapi</ghapi:type>
+<ghapi:hosted>false</ghapi:hosted>
+<ghapi:width>320</ghapi:width>
+<ghapi:height>215</ghapi:height>
+<ghapi:num_userprefs>0</ghapi:num_userprefs>
+<ghapi:weekly_pageviews>422834</ghapi:weekly_pageviews></item></channel></rss>
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-07-06 14:04:24 UTC (rev 7685)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF/jsp/edit.jsp 2007-07-06 14:31:35 UTC (rev 7686)
@@ -9,6 +9,7 @@
<%@ page import="org.jboss.portal.widget.google.type.EnumType" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
+<%@ page import="java.util.Collection" %>
<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>
<%@ page isELIgnored="false" %>
@@ -44,7 +45,7 @@
// Compute query
GGQuery query = new GGQuery(0, catTerm, queryTerm);
- GGQueryResult result = provider.search(query);
+ Collection widgets = provider.search(query);
%>
@@ -69,7 +70,7 @@
<p>
<table style="width:100%;border:1px solid" cellspacing="0" cellpadding="0">
<%
- for (IteratorStatus i = new IteratorStatus(result.getWidgetIterator()); i.hasNext();)
+ for (IteratorStatus i = new IteratorStatus(widgets.iterator()); i.hasNext();)
{
GGWidget widget = (GGWidget)i.next();
boolean selected = selWidget != null && selWidget.getId().equals(widget.getId());
@@ -80,7 +81,7 @@
selectURL.setParameter("content.uri", widget.getId());
// Set default parametrization state
- for (Iterator j = widget.getPreferencesInfo().getPreferencesInfo().iterator(); j.hasNext();)
+ for (Iterator j = widget.getInfo().getPreferences().getPreferences().iterator(); j.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)j.next();
String paramName = "content.param." + prefInfo.getName();
@@ -105,7 +106,7 @@
</p>
<%
- if (selWidget != null && !selWidget.getPreferencesInfo().getPreferencesInfo().isEmpty())
+ if (selWidget != null && !selWidget.getInfo().getPreferences().getPreferences().isEmpty())
{
PortletURL selectURL = renderResponse.createActionURL();
@@ -120,7 +121,7 @@
<p>
<form action="<%= selectURL %>" method="post">
<%
- for (Iterator i = selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
+ for (Iterator i = selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
if (prefInfo.getType().getOrdinal() == DataType.HIDDEN)
@@ -135,7 +136,7 @@
<table>
<tbody>
<%
- for (Iterator i = selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
+ for (Iterator i = selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
{
GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
16 years, 12 months