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/velocity JetspeedPowerTool.java
Date Thu, 15 Apr 2004 21:22:25 GMT
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: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message