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 at...@apache.org on 2006/04/13 22:48:03 UTC
svn commit: r393927 -
/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java
Author: ate
Date: Thu Apr 13 13:48:01 2006
New Revision: 393927
URL: http://svn.apache.org/viewcvs?rev=393927&view=rev
Log:
Correcting fix for JS2-315 which always leads to an IllegalArgumentException when a PortletDefinition isn't found.
Only cache a newly created PortletWindow which references a valid (existing) PortletEntity.
See: http://issues.us.apache.org/jira/browse/JS2-315
Modified:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java?rev=393927&r1=393926&r2=393927&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java Thu Apr 13 13:48:01 2006
@@ -47,6 +47,7 @@
protected final static Log log = LogFactory.getLog(PortletWindowAccessorImpl.class);
private Map windows = Collections.synchronizedMap(new HashMap());
+
private PortletEntityAccessComponent entityAccessor;
private boolean validateWindows = false;
@@ -167,8 +168,9 @@
}
private PortletWindow createPortletWindow(ContentFragment fragment, String principal) throws FailedToCreateWindowException, PortletEntityNotStoredException
- {
+ {
PortletWindow portletWindow = new PortletWindowImpl(fragment.getId());
+ boolean temporaryWindow = false;
MutablePortletEntity portletEntity = entityAccessor.getPortletEntityForFragment(fragment, principal);
if (portletEntity == null)
@@ -182,6 +184,11 @@
{
entityAccessor.storePortletEntity(portletEntity);
}
+ else
+ {
+ // don't cache the incomplete window
+ temporaryWindow = true;
+ }
}
catch (PortletEntityNotGeneratedException e)
{
@@ -200,8 +207,10 @@
}
((PortletWindowCtrl) portletWindow).setPortletEntity(portletEntity);
- windows.put(fragment.getId(), portletWindow);
-
+ if ( !temporaryWindow )
+ {
+ windows.put(fragment.getId(), portletWindow);
+ }
return portletWindow;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org