weaver      2004/02/23 16:43:23

  Modified:    portal/src/java/org/apache/jetspeed/aggregator
                        PortletWindowFactory.java
               portal/src/java/org/apache/jetspeed/velocity
                        JetspeedPowerTool.java
               portal/src/java/org/apache/jetspeed/aggregator/impl
                        PortletRendererImpl.java
  Log:
  refactored to use PortletEntityAccessComponent
  
  Revision  Changes    Path
  1.12      +5 -3      
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/PortletWindowFactory.java
  
  Index: PortletWindowFactory.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/PortletWindowFactory.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PortletWindowFactory.java 16 Jan 2004 19:37:03 -0000      1.11
  +++ PortletWindowFactory.java 24 Feb 2004 00:43:22 -0000      1.12
  @@ -53,8 +53,9 @@
    */
   package org.apache.jetspeed.aggregator;
   
  +import org.apache.jetspeed.Jetspeed;
  +import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
   import org.apache.jetspeed.om.window.impl.PortletWindowImpl;
  -import org.apache.jetspeed.entity.PortletEntityAccess;
   import org.apache.pluto.om.common.ObjectID;
   import org.apache.pluto.om.entity.PortletEntity;
   import org.apache.pluto.om.portlet.PortletDefinition;
  @@ -78,7 +79,8 @@
                throw new IllegalArgumentException("PortletDefinition for 
PortletWindow.getWindow() cannot be null.");
        }
        
  -        PortletEntity portletEntity = 
PortletEntityAccess.getEntity(portletDefinition, portletName);
  +     PortletEntityAccessComponent entityAccess = (PortletEntityAccessComponent) 
Jetspeed.getComponentManager().getComponent(PortletEntityAccessComponent.class);
  +        PortletEntity portletEntity = 
entityAccess.getPortletEntity(portletDefinition, portletName);
   
   
           // TODO: This needs to be changed to support multiple windows per entity
  
  
  
  1.6       +9 -6      
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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JetspeedPowerTool.java    21 Feb 2004 03:51:34 -0000      1.5
  +++ JetspeedPowerTool.java    24 Feb 2004 00:43:23 -0000      1.6
  @@ -76,11 +76,11 @@
   import org.apache.jetspeed.aggregator.ContentDispatcher;
   import org.apache.jetspeed.capability.CapabilityMap;
   import org.apache.jetspeed.components.ComponentManager;
  -import org.apache.jetspeed.locator.TemplateDescriptor;
  +import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
   import org.apache.jetspeed.locator.LocatorDescriptor;
  -import org.apache.jetspeed.locator.TemplateLocatorException;
  +import org.apache.jetspeed.locator.TemplateDescriptor;
   import org.apache.jetspeed.locator.TemplateLocator;
  -import org.apache.jetspeed.entity.PortletEntityAccess;
  +import org.apache.jetspeed.locator.TemplateLocatorException;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.om.page.Page;
   import org.apache.jetspeed.request.RequestContext;
  @@ -155,6 +155,7 @@
       private Locale locale;
       private LocatorDescriptor locatorDescriptor;
       private TemplateLocator locator;
  +    private PortletEntityAccessComponent entityAccess;
       /**
        * 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)
  @@ -205,6 +206,7 @@
           templateWriter = jspContext.getOut();
           fragmentStack = new Stack();
                clientSetup(Jetspeed.getCurrentRequestContext());
  +             entityAccess = (PortletEntityAccessComponent) 
Jetspeed.getComponentManager().getComponent(PortletEntityAccessComponent.class);
       }
   
       /**
  @@ -213,6 +215,7 @@
       public void init(Object obj)
       {
           Context ctx = null;
  +        entityAccess = (PortletEntityAccessComponent) 
Jetspeed.getComponentManager().getComponent(PortletEntityAccessComponent.class);
           if (obj instanceof ViewContext)
           {
               ViewContext viewContext = (ViewContext) obj;
  @@ -296,7 +299,7 @@
       {
           String fragmentId = getCurrentFragment().getId();
           JetspeedObjectID peid = JetspeedObjectID.createFromString(fragmentId);
  -        PortletEntity portletEntity = PortletEntityAccess.getEntity(peid);
  +        PortletEntity portletEntity = entityAccess.getPortletEntity(peid);
           return portletEntity;
       }
   
  @@ -307,7 +310,7 @@
        */
       public PortletEntity getPortletEntity(Fragment f)
       {
  -        PortletEntity portletEntity = 
PortletEntityAccess.getEntity(JetspeedObjectID.createFromString(f.getId()));
  +        PortletEntity portletEntity = 
entityAccess.getPortletEntity(JetspeedObjectID.createFromString(f.getId()));
           return portletEntity;
       }
   
  
  
  
  1.7       +6 -5      
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
  
  Index: PortletRendererImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PortletRendererImpl.java  23 Feb 2004 13:14:28 -0000      1.6
  +++ PortletRendererImpl.java  24 Feb 2004 00:43:23 -0000      1.7
  @@ -60,17 +60,17 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.fulcrum.InitializationException;
   import org.apache.jetspeed.Jetspeed;
  -import org.apache.jetspeed.aggregator.PortletRenderer;
   import org.apache.jetspeed.aggregator.ContentDispatcher;
   import org.apache.jetspeed.aggregator.ContentDispatcherCtrl;
  +import org.apache.jetspeed.aggregator.PortletRenderer;
   import org.apache.jetspeed.aggregator.PortletWindowFactory;
   import org.apache.jetspeed.aggregator.UnknownPortletDefinitionException;
  +import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
   import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent;
   import org.apache.jetspeed.container.PortletContainerFactory;
   import org.apache.jetspeed.cps.BaseCommonService;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.request.RequestContext;
  -import org.apache.jetspeed.entity.PortletEntityAccess;
   import org.apache.jetspeed.util.JetspeedObjectID;
   import org.apache.pluto.PortletContainer;
   import org.apache.pluto.PortletContainerException;
  @@ -229,7 +229,8 @@
       protected PortletWindow getPortletWindow(Fragment fragment) throws 
UnknownPortletDefinitionException
       {
           ObjectID oid = JetspeedObjectID.createFromString(fragment.getId());
  -        PortletEntity portletEntity = PortletEntityAccess.getEntity(oid);
  +        PortletEntityAccessComponent entityAccess = (PortletEntityAccessComponent) 
Jetspeed.getComponentManager().getComponent(PortletEntityAccessComponent.class);
  +        PortletEntity portletEntity = entityAccess.getPortletEntity(oid);
           PortletWindow portletWindow = null;
   
           if (portletEntity==null)
  @@ -246,7 +247,7 @@
               // fix issues, persist entity and update fragment ID
               try
               {
  -                
PortletEntityAccess.storePortletEntity(portletWindow.getPortletEntity());
  +                entityAccess.storePortletEntity(portletWindow.getPortletEntity());
               }
               catch (Exception e)
               {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to