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/portal/src/java/org/apache/jetspeed/container/window/impl PortletWindowAccessorImpl.java
Date Tue, 11 Jan 2005 20:02:17 GMT
weaver      2005/01/11 12:02:17

  Modified:    portal/src/java/org/apache/jetspeed/container/window/impl
                        PortletWindowAccessorImpl.java
  Log:
  Moved ContentDispatcher functionallity into FragmentImpl and RenderingJob.  Split PortletContent
into a top level interface and implementation.
  
  Revision  Changes    Path
  1.11      +36 -2     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java
  
  Index: PortletWindowAccessorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PortletWindowAccessorImpl.java	4 Jan 2005 16:12:47 -0000	1.10
  +++ PortletWindowAccessorImpl.java	11 Jan 2005 20:02:17 -0000	1.11
  @@ -100,10 +100,39 @@
                   throw new FailedToRetrievePortletWindow(e.toString(), e);
               }
           }
  +        else
  +        {
  +            validateWindow(fragment, portletWindow);
  +        }
  +        
           return portletWindow;
       }
       
  -    public PortletWindow getPortletWindow(Fragment fragment, String principal) throws FailedToCreateWindowException
  +    /**
  +     * <p>
  +     * validateWindow
  +     * </p>
  +     *
  +     * @param fragment
  +     * @param portletWindow
  +     * @throws InconsistentWindowStateException
  +     */
  +    protected void validateWindow( Fragment fragment, PortletWindow portletWindow ) throws
FailedToRetrievePortletWindow
  +    {
  +        // make sure the window has the most up-to-date portlet entity
  +        PortletEntity portletEntity = entityAccessor.getPortletEntityForFragment(fragment);
  +        if(portletEntity != null)
  +        {
  +            ((PortletWindowCtrl) portletWindow).setPortletEntity(portletEntity);
  +        }
  +        else
  +        {
  +            removeWindow(portletWindow);  
  +            throw new FailedToRetrievePortletWindow("No PortletEntity exists for for id
"+fragment.getId()+" removing window from cache.");
  +        }
  +    }
  +
  +    public PortletWindow getPortletWindow(Fragment fragment, String principal) throws FailedToRetrievePortletWindow,
FailedToCreateWindowException
       {
           ArgUtil.assertNotNull(Fragment.class, fragment, this, "getPortletWindow(Fragment
fragment, String principal)");
           ArgUtil.assertNotNull(String.class, principal, this, "getPortletWindow(Fragment
fragment, String principal)");
  @@ -112,6 +141,11 @@
           {
               return createPortletWindow(fragment, principal);
           }        
  +        else
  +        {
  +            // make sure the window has the most up-to-date portlet entity
  +            validateWindow(fragment, portletWindow);
  +        }
           return portletWindow;
       }
   
  
  
  

---------------------------------------------------------------------
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