portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity PersistenceBrokerPortletEntityAccess.java
Date Tue, 04 Jan 2005 15:53:43 GMT
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


Mime
View raw message