weaver 2004/04/15 14:22:25
Modified: portal/src/java/org/apache/jetspeed/velocity
JetspeedPowerTool.java
Log:
Fixed issues with the JetspeedPowerTool not being able to locate the PortletEntity.
Now fecthes
the PortletEntity directly from the current Window. Titles now display properly
again.
Revision Changes Path
1.10 +7 -5
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java
Index: JetspeedPowerTool.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedPowerTool.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JetspeedPowerTool.java 14 Mar 2004 05:10:01 -0000 1.9
+++ JetspeedPowerTool.java 15 Apr 2004 21:22:25 -0000 1.10
@@ -39,6 +39,7 @@
import org.apache.jetspeed.capability.CapabilityMap;
import org.apache.jetspeed.components.ComponentManager;
import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
+import org.apache.jetspeed.container.window.PortletWindowAccessor;
import org.apache.jetspeed.locator.LocatorDescriptor;
import org.apache.jetspeed.locator.TemplateDescriptor;
import org.apache.jetspeed.locator.TemplateLocator;
@@ -120,6 +121,8 @@
private PortletEntityAccessComponent entityAccess;
private TemplateLocator decorationLocator;
private LocatorDescriptor decorationLocatorDescriptor;
+ private ComponentManager cm;
+ private PortletWindowAccessor windowAccess;
/**
* Empty constructor DO NOT USE!!!! This is only here to allow creation of the
* via the Velocity Tool Box. For proper use out side the tool box use @see
#JetspeedPowerTool(javax.portlet.RenderRequest, javax.portlet.RenderResponse,
javax.portlet.PortletConfig)
@@ -127,6 +130,8 @@
public JetspeedPowerTool()
{
super();
+ cm = Jetspeed.getComponentManager();
+ windowAccess = (PortletWindowAccessor)
cm.getComponent(PortletWindowAccessor.class);
}
@@ -261,10 +266,7 @@
*/
public PortletEntity getCurrentPortletEntity()
{
- String fragmentId = getCurrentFragment().getId();
- JetspeedObjectID peid = JetspeedObjectID.createFromString(fragmentId);
- PortletEntity portletEntity = entityAccess.getPortletEntity(peid);
- return portletEntity;
+ return
windowAccess.getPortletWindow(getCurrentFragment()).getPortletEntity();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]