portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r760753 [2/2] - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/pages/Public/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/ components/jetspeed-portal/src/main/java/org/apac...
Date Wed, 01 Apr 2009 01:01:59 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
Wed Apr  1 01:01:57 2009
@@ -204,7 +204,7 @@
         try
         {
             boolean desktopRequestNotAjax = false;
-            if ( parameters.containsKey(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER)
)
+            if ( parameters != null && parameters.containsKey(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER)
)
             {
             	desktopRequestNotAjax = true;
             	parameters.remove(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
Wed Apr  1 01:01:57 2009
@@ -332,7 +332,7 @@
     {
         boolean fragmentSupportsActions = false;
         PortletWindow window = requestContext.getPortletWindow(fragment); 
-        if (window == null)
+        if (!window.isValid())
         {
             return fragmentSupportsActions; // allow nothing
         }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java
Wed Apr  1 01:01:57 2009
@@ -222,7 +222,7 @@
             }
         }
         PortletWindow portletWindow = rc.getPortletWindow(fragment.getId());
-        if (portletWindow == null)
+        if (portletWindow == null || !portletWindow.isValid())
             return eventTargets;
 
         PortletDefinition portlet = portletWindow.getPortletDefinition();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
Wed Apr  1 01:01:57 2009
@@ -153,9 +153,9 @@
             	}
             	//pageActionAccess.
             	PortletWindow window = requestContext.getPortletWindow(fragment);
-            	if (window == null)
+            	if (!window.isValid())
             	{
-            	    throw new Exception("Portlet Window creation failed for fragment: "+ fragment.getId()
+ ", " + fragment.getName());
+            	    throw new Exception("Failed to retrieve Portlet Definition for: "+ fragment.getId()
+ ", " + fragment.getName());
             	}
             	PortletMode currentMode = requestContext.getPortalURL().getNavigationalState().getMode(
window );
             	WindowState currentState = requestContext.getPortalURL().getNavigationalState().getState(
window );

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/request/JetspeedRequestContext.java
Wed Apr  1 01:01:57 2009
@@ -29,9 +29,10 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
-import org.apache.jetspeed.aggregator.ContentDispatcher;
 import org.apache.jetspeed.aggregator.impl.PortletAggregatorFragmentImpl;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.ContainerConstants;
@@ -66,6 +67,8 @@
  */
 public class JetspeedRequestContext implements RequestContext
 {
+    protected final static Log log = LogFactory.getLog(JetspeedRequestContext.class);
+    
     private static final String ACTION_ERROR_ATTR = "org.apache.jetspeed.action.error:";
     private static final String INSTANT_WINDOWS_SESSION_KEY = "org.apache.jetspeed.instant.windows";
     
@@ -81,7 +84,6 @@
     private PortletDefinition portletDefinition;
     private Subject subject;
     private Locale locale;
-    private ContentDispatcher dispatcher;
     private Pipeline pipeline;
 
     private CapabilityMap capabilityMap;
@@ -197,16 +199,6 @@
         this.portletDefinition = portletDefinition;
     }
 
-    public ContentDispatcher getContentDispatcher()
-    {
-        return dispatcher;
-    }
-
-    public void setContentDispatcher( ContentDispatcher dispatcher )
-    {
-        this.dispatcher = dispatcher;
-    }
-
     /**
      * get the Capability Map
      *  
@@ -609,6 +601,10 @@
     
     public void setCurrentPortletWindow(PortletWindow window)
     {
+        if (window != null && !window.isValid())
+        {
+            throw new IllegalStateException("Invalid window: "+window.getId()+" should not
be invoked");
+        }
         currentWindow.set(window);
     }
     
@@ -626,12 +622,15 @@
             if (pd != null)
             {
                 window = new PortletWindowImpl(this, fragment, pd);
-                portletWindows.put(window.getWindowId(), window);
             }
             else
             {
+                // invalid window: create one anyway so that this error condition is only
"recorded" once for this request
+                window = new PortletWindowImpl(this, fragment);
                 fragment.overrideRenderedContent("Failed to retrieve Portlet Definition for
" + fragment.getName());
+                log.error(fragment.getOverriddenContent());
             }
+            portletWindows.put(window.getWindowId(), window);
         }
         return window;
     }
@@ -689,6 +688,10 @@
     @SuppressWarnings("unchecked")
     public void registerInstantlyCreatedPortletWindow(PortletWindow portletWindow)
     {
+        if (!portletWindow.isValid())
+        {
+            throw new IllegalStateException("Invalid window "+portletWindow.getId()+" should
not be registered");
+        }
         HttpSession session = getRequest().getSession(true);
         synchronized (session)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolFactory.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolFactory.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolFactory.java
Wed Apr  1 01:01:57 2009
@@ -28,7 +28,6 @@
 import org.apache.jetspeed.aggregator.PortletRenderer;
 import org.apache.jetspeed.layout.JetspeedPowerTool;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.services.title.DynamicTitleService;
 
 public class JetspeedPowerToolFactory implements org.apache.jetspeed.layout.JetspeedPowerToolFactory
 {
@@ -36,19 +35,17 @@
     
     private Class jptClass;
     private Constructor constructor;
-    private DynamicTitleService titleService;
     
     /* Allows us to render portlets and other fragments */
     private PortletRenderer renderer;
     
-    public JetspeedPowerToolFactory(String jptClassName, DynamicTitleService titleService,
PortletRenderer renderer)
+    public JetspeedPowerToolFactory(String jptClassName, PortletRenderer renderer)
     throws ClassNotFoundException, NoSuchMethodException
     {
         jptClass = Thread.currentThread().getContextClassLoader().loadClass(jptClassName);
         constructor =
             jptClass.getConstructor(
-                new Class[] {RequestContext.class, PortletConfig.class, RenderRequest.class,
RenderResponse.class, DynamicTitleService.class, PortletRenderer.class});        
-        this.titleService = titleService;
+                new Class[] {RequestContext.class, PortletConfig.class, RenderRequest.class,
RenderResponse.class, PortletRenderer.class});        
         this.renderer = renderer;
     }
        
@@ -57,7 +54,7 @@
     {
         try
         {
-        	Object [] initArgs = { requestContext, portletConfig, renderRequest, renderResponse,
this.titleService, this.renderer };
+        	Object [] initArgs = { requestContext, portletConfig, renderRequest, renderResponse,
this.renderer };
             return (JetspeedPowerTool)constructor.newInstance(initArgs);
         }
         catch (Exception e)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
Wed Apr  1 01:01:57 2009
@@ -45,7 +45,6 @@
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.BasePortalURL;
-import org.apache.jetspeed.container.window.FailedToCreateWindowException;
 import org.apache.jetspeed.locator.LocatorDescriptor;
 import org.apache.jetspeed.locator.TemplateDescriptor;
 import org.apache.jetspeed.locator.TemplateLocator;
@@ -55,7 +54,6 @@
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.services.title.DynamicTitleService;
 import org.apache.jetspeed.util.ArgUtil;
 import org.apache.jetspeed.util.Path;
 import org.apache.velocity.context.Context;
@@ -123,17 +121,14 @@
 
     protected Context velocityContext;
 
-    private DynamicTitleService titleService;
-    
     private BasePortalURL baseUrlAccess;
     
     private PortletRenderer renderer;
 
-    public JetspeedPowerToolImpl(RequestContext requestContext, PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse, DynamicTitleService titleService,PortletRenderer
renderer) throws Exception
+    public JetspeedPowerToolImpl(RequestContext requestContext, PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse, PortletRenderer renderer) throws
Exception
     {
         HttpServletRequest request = requestContext.getRequest();
         this.requestContext = requestContext;
-        this.titleService = titleService;
         try
         {
             baseUrlAccess = (BasePortalURL) getComponent("BasePortalURL");
@@ -188,12 +183,19 @@
     {
         try
         {
-            return getRequestContext().getPortalURL().getNavigationalState().getState(getPortletWindow(getCurrentFragment()));
+            PortletWindow window = getPortletWindow(getCurrentFragment());
+            if (!window.isValid())
+            {
+                // return a sensible default value to allow a mimimum level of processing
to continue
+                return WindowState.NORMAL;
+            }
+            return getRequestContext().getPortalURL().getNavigationalState().getState(window);
         }
         catch (Exception e)
         {
             handleError(e, e.toString(), getCurrentFragment());
-            return null;
+            // return a sensible default value to allow a mimimum level of processing to
continue
+            return WindowState.NORMAL;
         }
     }
 
@@ -207,12 +209,19 @@
     {
         try
         {
-            return getRequestContext().getPortalURL().getNavigationalState().getMappedState(getPortletWindow(getCurrentFragment()));
+            PortletWindow window = getPortletWindow(getCurrentFragment());
+            if (!window.isValid())
+            {
+                // return a sensible default value to allow a mimimum level of processing
to continue
+                return WindowState.NORMAL;
+            }
+            return getRequestContext().getPortalURL().getNavigationalState().getMappedState(window);
         }
         catch (Exception e)
         {
             handleError(e, e.toString(), getCurrentFragment());
-            return null;
+            // return a sensible default value to allow a mimimum level of processing to
continue
+            return WindowState.NORMAL;
         }
     }
 
@@ -226,12 +235,19 @@
     {
         try
         {
-            return getRequestContext().getPortalURL().getNavigationalState().getMode(getPortletWindow(getCurrentFragment()));
+            PortletWindow window = getPortletWindow(getCurrentFragment());
+            if (!window.isValid())
+            {
+                // return a sensible default value to allow a mimimum level of processing
to continue
+                return PortletMode.VIEW;
+            }
+            return getRequestContext().getPortalURL().getNavigationalState().getMode(window);
         }
         catch (Exception e)
         {
             handleError(e, e.toString(), getCurrentFragment());
-            return null;
+            // return a sensible default value to allow a mimimum level of processing to
continue
+            return PortletMode.VIEW;
         }
     }
 
@@ -245,12 +261,19 @@
     {
         try
         {
-            return getRequestContext().getPortalURL().getNavigationalState().getMappedMode(getPortletWindow(getCurrentFragment()));
+            PortletWindow window = getPortletWindow(getCurrentFragment());
+            if (!window.isValid())
+            {
+                // return a sensible default value to allow a mimimum level of processing
to continue
+                return PortletMode.VIEW;
+            }
+            return getRequestContext().getPortalURL().getNavigationalState().getMappedMode(window);
         }
         catch (Exception e)
         {
             handleError(e, e.toString(), getCurrentFragment());
-            return null;
+            // return a sensible default value to allow a mimimum level of processing to
continue
+            return PortletMode.VIEW;
         }
     }
 
@@ -334,12 +357,7 @@
      */
     public PortletWindow getPortletWindow(ContentFragment f) throws Exception
     {
-        PortletWindow window = getRequestContext().getPortletWindow(f);
-        if (window == null)
-        {
-            throw new FailedToCreateWindowException("Portlet Window creation failed for fragment:
"+ f.getId() + ", " + f.getName());
-        }
-        return window;
+        return getRequestContext().getPortletWindow(f);
     }
     
     /**
@@ -433,7 +451,7 @@
             directError.write("Error occured process includeTemplate(): " + e.toString()
+ "\n\n");
             e.printStackTrace(directError);
             directError.close();
-            return null;
+            return "";
         }
     }
 
@@ -450,7 +468,7 @@
             directError.write("Error occured process includeDecoration(): " + e.toString()
+ "\n\n");
             e.printStackTrace(directError);
             directError.close();
-            return null;
+            return "";
         }
     }
 
@@ -480,7 +498,7 @@
         catch (Exception e)
         {
             renderResponse.getWriter().write(e.toString());
-            return null;
+            return "";
         }
 
     }
@@ -609,7 +627,6 @@
         catch (TemplateLocatorException e)
         {
             log.error("Unable to locate template: " + path, e);
-//            System.out.println("Unable to locate template: " + path);
             throw e;
         }
     }
@@ -622,18 +639,18 @@
      * @param e
      * @param msg
      */
+    @SuppressWarnings("unchecked")
     protected void handleError(Exception e, String msg, ContentFragment fragment)
     {
         log.error(msg, e);
 
-        Set exceptions = (Set) renderRequest.getAttribute(FRAGMENT_PROCESSING_ERROR_PREFIX
+ fragment.getId());
+        Set<Exception> exceptions = (Set<Exception>) renderRequest.getAttribute(FRAGMENT_PROCESSING_ERROR_PREFIX
+ fragment.getId());
         if (exceptions == null)
         {
-            exceptions = new HashSet();
+            exceptions = new HashSet<Exception>();
             setAttribute(FRAGMENT_PROCESSING_ERROR_PREFIX + fragment.getId(), exceptions);
         }
         exceptions.add(e);
-
     }
 
     /**
@@ -677,26 +694,22 @@
     public String getTitle(ContentFragment f)
     {
         String title = null;
-
         if (f != null)
         {
             title = f.getTitle();
-        }
-
-        if (title == null)
-        {
-            try
+            if (title == null && f.getPortletContent() != null)
             {
-
-                return titleService.getDynamicTitle(getPortletWindow(f), getRequestContext().getRequest());
+                title = f.getPortletContent().getTitle();
             }
-            catch (Exception e)
+            else
             {
-                log.error("Unable to reteive portlet title: " + e.getMessage(), e);
-                return "Title Error: " + e.getMessage();
+                title = f.getName();
+                if (title != null && title.indexOf("::") > -1)
+                {
+                    title = title.substring(title.indexOf("::")+2);
+                }
             }
         }
-
         return title;
     }
 
@@ -805,9 +818,13 @@
                 fragment.setName(portletId);
                 ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap(),
true);
                 window = getPortletWindow(contentFragment);
-                context.registerInstantlyCreatedPortletWindow(window);
-                renderer.renderNow(window.getFragment(), context, true);
-                return window.getFragment().getRenderedContent();
+                if (window.isValid())
+                {
+                    context.registerInstantlyCreatedPortletWindow(window);
+                    renderer.renderNow(window.getFragment(), context, true);
+                    return window.getFragment().getRenderedContent();
+                }
+                return "";
             }
             else
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/aggregator/MockRenderJob.java
Wed Apr  1 01:01:57 2009
@@ -117,12 +117,6 @@
         return null;
     }
 
-    public ContentDispatcherCtrl getDispatcher()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
     public int getExpirationCache()
     {
         // TODO Auto-generated method stub

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/MockRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/MockRequestContext.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/MockRequestContext.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/container/state/MockRequestContext.java
Wed Apr  1 01:01:57 2009
@@ -26,7 +26,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.jetspeed.aggregator.ContentDispatcher;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.PortalURL;
@@ -91,15 +90,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.request.RequestContext#getContentDispatcher()
-     */
-    public ContentDispatcher getContentDispatcher()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.request.RequestContext#getCurrentPortletWindow()
      */
     public PortletWindow getCurrentPortletWindow()
@@ -364,14 +354,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jetspeed.request.RequestContext#setContentDispatcher(org.apache.jetspeed.aggregator.ContentDispatcher)
-     */
-    public void setContentDispatcher(ContentDispatcher dispatcher)
-    {
-        // TODO Auto-generated method stub
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.jetspeed.request.RequestContext#setLocale(java.util.Locale)
      */
     public void setLocale(Locale locale)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/window/MockPortletWindow.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/window/MockPortletWindow.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/window/MockPortletWindow.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/window/MockPortletWindow.java
Wed Apr  1 01:01:57 2009
@@ -228,4 +228,10 @@
         // TODO Auto-generated method stub
         return null;
     }
+
+    public boolean isValid()
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
Wed Apr  1 01:01:57 2009
@@ -69,6 +69,15 @@
     private transient PortletRequestContext portletRequestContext;
     private transient PortletResponse portletResponse;
     private transient PortletInstance portletInstance;
+
+    private boolean valid;
+    
+    public PortletWindowImpl(RequestContext requestContext, ContentFragment fragment)
+    {
+        this.requestContext = requestContext;
+        this.fragment = fragment;
+        this.id = fragment.getId();
+    }
     
     public PortletWindowImpl(RequestContext requestContext, ContentFragment fragment, PortletDefinition
pd)
     {
@@ -76,6 +85,12 @@
         this.id = fragment.getId();
         this.fragment = fragment;
         this.pd = pd;
+        this.valid = true;
+    }
+    
+    public boolean isValid()
+    {
+        return valid;
     }
 
     public String getWindowId()
@@ -143,12 +158,12 @@
 
     public PortletMode getPortletMode()
     {
-        return requestContext.getPortalURL().getNavigationalState().getMode(this);
+        return valid ? requestContext.getPortalURL().getNavigationalState().getMode(this)
: PortletMode.VIEW;
     }
 
     public WindowState getWindowState()
     {
-        return requestContext.getPortalURL().getNavigationalState().getState(this);
+        return valid ? requestContext.getPortalURL().getNavigationalState().getState(this)
: WindowState.NORMAL;
     }
 
     public Map<String,Object> getAttributes()
@@ -225,6 +240,10 @@
                                    PortletRequest portletRequest, PortletResponse portletResponse,

                                    PortletInstance portletInstance)
     {
+        if (!valid)
+        {
+            throw new IllegalStateException("Invalid window "+getId()+" should not have been
invoked");
+        }
         this.action = action;
         this.portletRequest = portletRequest;
         this.portletResponseContext = portletResponseContext;

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
Wed Apr  1 01:01:57 2009
@@ -53,8 +53,6 @@
     public static final String PREFERED_LOCALE_ATTRIBUTE = "org.apache.jetspeed.prefered.locale";
     public static final String PREFERED_CHARACTERENCODING_ATTRIBUTE = "org.apache.jetspeed.prefered.characterencoding";
     public static final String PORTLET_CONTENT_ATTRIBUTE = "org.apache.jetspeed.PortletContent";
-    public static final String CONTENT_DISPATCHER_ATTRIBUTE = "org.apache.jetspeed.ContentDispatcher";
-    public static final String OVERRIDE_PORTLET_TITLE_ATTR = "org.apache.jetspeed.portlet.title";
     public static final String HEADER_RESOURCE_ATTRIBUTE = "org.apache.jetspeed.headerresource";
     public static final String HEADER_CONFIGURATION_ATTRIBUTE = "org.apache.jetspeed.headerconfiguration";
     public static final String HEADER_NAMED_RESOURCE_ATTRIBUTE = "org.apache.jetspeed.headernamedresource";

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletRenderer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletRenderer.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletRenderer.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/PortletRenderer.java
Wed Apr  1 01:01:57 2009
@@ -23,7 +23,6 @@
 
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.PortletWindow;
 
 /**
  * <h4>PortletRendererService<br />
@@ -41,57 +40,36 @@
     /**
         Render the specified Page fragment.
         Result is returned in the PortletResponse.
-     * @throws FailedToRenderFragmentException
-     * @throws UnknownPortletDefinitionException
-     * @throws PortletAccessDeniedException
      */
-    public void renderNow(ContentFragment fragment, RequestContext request) ;
+    public void renderNow(ContentFragment fragment, RequestContext request);
 
     /**
      * Render the specified Page fragment in a separate Thread from the current (rendering)
Thread
      * Result is returned in the PortletResponse.
-     * @throws FailedToRenderFragmentException
-     * @throws UnknownPortletDefinitionException
-     * @throws PortletAccessDeniedException
     */
-    public void renderNow(ContentFragment fragment, RequestContext request, boolean spawned)
;
-
+    public void renderNow(ContentFragment fragment, RequestContext request, boolean spawned);
 
     /**
         Render the specified Page fragment.
         Result is returned in the PortletResponse.
-     * @throws FailedToRenderFragmentException
-     * @throws UnknownPortletDefinitionException
-     * @throws PortletAccessDeniedException
-     */
-    public void renderNow(ContentFragment fragment, HttpServletRequest request, HttpServletResponse
response) ;
-
-    /** 
-     * 
-     * Render the specified Page fragment.
-     * The method returns before rendering is complete, rendered content can be
-     * accessed through the ContentDispatcher
-     * @return the asynchronous portlet rendering job to synchronize
-     * @deprecated
      */
-    public RenderingJob render(ContentFragment fragment, RequestContext request);
+    public void renderNow(ContentFragment fragment, HttpServletRequest request, HttpServletResponse
response);
 
     /** 
      * 
      * Create a rendering job for the specified Page fragment.
      * The method returns a rendering job which should be passed to 'processRenderingJob(RenderingJob
job)' method.
      * @return portlet rendering job to pass to render(RenderingJob job) method
-     * @throws UnknownPortletDefinitionException
      * @throws PortletAccessDeniedException
      */
-    public RenderingJob createRenderingJob(ContentFragment fragment, RequestContext request);
+    public RenderingJob createRenderingJob(ContentFragment fragment, RequestContext request)
+    throws PortletAccessDeniedException;
 
     /** 
      * 
      * Render the specified rendering job.
      * The method returns before rendering is complete when the job is processed in parallel
mode.
      * When the job is not parallel mode, it returns after rendering is complete.
-     * @throws FailedToRenderFragmentException
      */
     public void processRenderingJob(RenderingJob job);
         
@@ -99,14 +77,9 @@
      * Wait for all rendering jobs in the collection to finish successfully or otherwise.

      * @param renderingJobs the Collection of rendering job objects to wait for.
      */
-    public void waitForRenderingJobs(List renderingJobs);
+    public void waitForRenderingJobs(List<RenderingJob> renderingJobs);
     
     /**
-     * Retrieve the ContentDispatcher for the specified request
-     */
-    public ContentDispatcher getDispatcher(RequestContext request, boolean isParallel);
-
-    /**
      * Notify that content completed by worker jobs 
      * So that renderer can update its state
      * 
@@ -114,19 +87,6 @@
      */
     public void notifyContentComplete(PortletContent content);
 
-    /**
-     * Set title of portlet window. 
-     * 
-     * @param portletWindow
-     * @param request
-     * @param response
-     * @param dispatcher
-     * @param isCacheTitle
-     */
-    public void addTitleToHeader( PortletWindow portletWindow, 
-                                  HttpServletRequest request, HttpServletResponse response,

-                                  ContentDispatcherCtrl dispatcher, boolean isCacheTitle
);
-
     PortletTrackingManager getPortletTrackingManager();
     
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/RenderingJob.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/RenderingJob.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/RenderingJob.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/RenderingJob.java
Wed Apr  1 01:01:57 2009
@@ -58,10 +58,6 @@
 
     int getExpirationCache();
 
-    ContentDispatcherCtrl getDispatcher();
-
-    boolean isContentCached();
-    
     void setWorkerAttribute(String name, Object value);
     
     Object getWorkerAttribute(String name);

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/WorkerMonitor.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/WorkerMonitor.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/WorkerMonitor.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/aggregator/WorkerMonitor.java
Wed Apr  1 01:01:57 2009
@@ -71,5 +71,5 @@
      * Wait for all rendering jobs in the collection to finish successfully or otherwise.

      * @param renderingJobs the Collection of rendering job objects to wait for.
      */
-    public void waitForRenderingJobs(List renderingJobs);
+    public void waitForRenderingJobs(List<RenderingJob> renderingJobs);
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/PortletWindow.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/PortletWindow.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/PortletWindow.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/PortletWindow.java
Wed Apr  1 01:01:57 2009
@@ -36,6 +36,7 @@
  */
 public interface PortletWindow extends org.apache.pluto.container.PortletWindow, Serializable
 {
+    boolean isValid();
     PortletWindowID getId();
     String getWindowId();
     String getPortletEntityId();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java
Wed Apr  1 01:01:57 2009
@@ -26,7 +26,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.jetspeed.aggregator.ContentDispatcher;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.url.PortalURL;
@@ -143,17 +142,6 @@
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.jetspeed.request.RequestContext#getContentDispatcher()
-     */
-    public ContentDispatcher getContentDispatcher()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
      * @see org.apache.jetspeed.request.RequestContext#getLocale()
      */
     public Locale getLocale()
@@ -324,17 +312,6 @@
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.jetspeed.request.RequestContext#setContentDispatcher(org.apache.jetspeed.aggregator.ContentDispatcher)
-     */
-    public void setContentDispatcher( ContentDispatcher dispatcher )
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
      * @see org.apache.jetspeed.request.RequestContext#setLocale(java.util.Locale)
      */
     public void setLocale( Locale locale )

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/request/RequestContext.java
Wed Apr  1 01:01:57 2009
@@ -26,7 +26,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.jetspeed.PortalReservedParameters;
-import org.apache.jetspeed.aggregator.ContentDispatcher;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.om.page.ContentFragment;
@@ -121,20 +120,6 @@
     public void setPage(ContentPage page);
 
     /**
-     * Gets the content dispatcher for this request
-     *
-     * @return ContentDispatcher
-     */
-    public ContentDispatcher getContentDispatcher();
-
-    /**
-     * Sets the content dispatcher for this request
-     *
-     * @param dispatcher The ContentDispatcher to use for this request
-     */
-    public void setContentDispatcher(ContentDispatcher dispatcher);
-
-    /**
      * Set the capabilityMap. Used by the CapabilityValve
      *
      * @param capabilityMap

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/aggregation.xml
Wed Apr  1 01:01:57 2009
@@ -47,7 +47,10 @@
     class="org.apache.jetspeed.aggregator.impl.PortletAggregatorImpl">
     <meta key="j2:cat" value="default" />
     <constructor-arg>
-      <ref bean="org.apache.jetspeed.aggregator.PortletRendererWithTitleHeader" />
+      <ref bean="org.apache.jetspeed.aggregator.PortletRenderer" />
+    </constructor-arg>
+    <constructor-arg type="boolean">
+      <value>true</value>
     </constructor-arg>
   </bean>
 
@@ -65,9 +68,6 @@
       <ref bean="PortalStatistics" />
     </constructor-arg>
     <constructor-arg>
-      <ref bean="org.apache.pluto.services.title.DynamicTitleService" />
-    </constructor-arg>
-    <constructor-arg>
       <ref bean="org.apache.jetspeed.aggregator.PortletTrackingManager" />
     </constructor-arg>
     <!-- flag indicating whether to check jetspeed-portlet.xml security constraints
@@ -84,42 +84,6 @@
     </constructor-arg>
   </bean>
 
-  <!-- Portlet Renderer w/title in http response header -->
-  <bean id="org.apache.jetspeed.aggregator.PortletRendererWithTitleHeader"
-    class="org.apache.jetspeed.aggregator.impl.PortletRendererImpl" init-method="start" destroy-method="stop">
-    <meta key="j2:cat" value="default" />
-    <constructor-arg>
-      <ref bean="org.apache.pluto.PortletContainer" />
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="org.apache.jetspeed.aggregator.WorkerMonitor" />
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="PortalStatistics" />
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="org.apache.pluto.services.title.DynamicTitleService" />
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="org.apache.jetspeed.aggregator.PortletTrackingManager" />
-    </constructor-arg>
-    <!-- flag indicating whether to check jetspeed-portlet.xml security constraints
-      before rendering a portlet. If security check fails, do not display portlet content
-    -->
-    <constructor-arg type="boolean">
-      <value>true</value>
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="org.apache.jetspeed.security.SecurityAccessController" />
-    </constructor-arg>
-    <constructor-arg>
-      <ref bean="portletContentCache" />
-    </constructor-arg>
-    <constructor-arg type="boolean">
-      <value>true</value>
-    </constructor-arg>
-  </bean>
-
   <bean id="org.apache.jetspeed.aggregator.PageAggregator"
     class="org.apache.jetspeed.aggregator.impl.PageAggregatorImpl">
     <meta key="j2:cat" value="default" />

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/jetspeed-spring.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/jetspeed-spring.xml?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/jetspeed-spring.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/jetspeed-spring.xml
Wed Apr  1 01:01:57 2009
@@ -58,11 +58,8 @@
     <constructor-arg index="0">
       <value>org.apache.jetspeed.velocity.JetspeedPowerToolImpl</value>
     </constructor-arg>
-    <constructor-arg index="1">
-      <ref bean="DynamicTitleService" />
-    </constructor-arg>
     <!-- Added so we can render portlets in JPT -->
-    <constructor-arg index="2">
+    <constructor-arg index="1">
       <ref bean="org.apache.jetspeed.aggregator.PortletRenderer" />
     </constructor-arg>
   </bean>
@@ -122,9 +119,4 @@
     </constructor-arg>
   </bean>
 
-  <bean id="org.apache.pluto.services.title.DynamicTitleService" name="DynamicTitleService"
-    class="org.apache.jetspeed.services.title.DynamicTitleServiceImpl">
-    <meta key="j2:cat" value="default" />
-  </bean>
-
 </beans>
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml?rev=760753&r1=760752&r2=760753&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml
Wed Apr  1 01:01:57 2009
@@ -60,7 +60,6 @@
     <bean id="org.apache.pluto.container.PortletRequestContextService"
           class="org.apache.jetspeed.container.impl.PortletRequestContextServiceImpl">
       <meta key="j2:cat" value="default" />
-      <constructor-arg><ref bean="DynamicTitleService"/></constructor-arg>
  
     </bean>
     
     <bean id="org.apache.pluto.container.FilterManagerService"



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message