You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by we...@apache.org on 2005/01/04 16:53:43 UTC
cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity PersistenceBrokerPortletEntityAccess.java
weaver 2005/01/04 07:53:43
Modified: components/registry/src/java/org/apache/jetspeed/components/portletentity
PersistenceBrokerPortletEntityAccess.java
Log:
added support for generating entities that have no portlet definition. This allows us to communicate the error to end user
via the rendered fragment.
Revision Changes Path
1.2 +15 -8 jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PersistenceBrokerPortletEntityAccess.java
Index: PersistenceBrokerPortletEntityAccess.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PersistenceBrokerPortletEntityAccess.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PersistenceBrokerPortletEntityAccess.java 29 Oct 2004 14:04:16 -0000 1.1
+++ PersistenceBrokerPortletEntityAccess.java 4 Jan 2005 15:53:43 -0000 1.2
@@ -84,18 +84,25 @@
{
PortletDefinition pd = registry.getPortletDefinitionByUniqueName(fragment.getName());
ObjectID entityKey = generateEntityKey(fragment, principal);
+ MutablePortletEntity portletEntity = null;
- if (pd == null)
+ if (pd != null)
{
- throw new PortletEntityNotGeneratedException("Failed to retrieve Portlet Definition for "
- + fragment.getName());
+ portletEntity = newPortletEntityInstance(pd);
+ if (portletEntity == null)
+ {
+ throw new PortletEntityNotGeneratedException("Failed to create Portlet Entity for "
+ + fragment.getName());
+ }
}
-
- MutablePortletEntity portletEntity = newPortletEntityInstance(pd);
- if (portletEntity == null)
+ else
{
- throw new PortletEntityNotGeneratedException("Failed to create Portlet Entity for " + fragment.getName());
+ String msg = "Failed to retrieve Portlet Definition for " + fragment.getName();
+ logger.warn(msg);
+ portletEntity = new PortletEntityImpl();
+ fragment.setRenderedContent(msg);
}
+
portletEntity.setId(entityKey.toString());
return portletEntity;
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org