List of Components

Example of Component: portal/src/java/org/apache/jetspeed/container/window/impl/PortletWindowAccessorImpl.java

Bean Definition in jetspeed-spring.xml

<!-- Portlet Window Component -->
  <bean id="org.apache.jetspeed.container.window.PortletWindowAccessor"
           class="org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl">
     <constructor-arg >
       <ref bean="org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent" />
     </constructor-arg>
  </bean>

It is used in org.apache.jetspeed.velocity.JetspeedPowerTool:

    public JetspeedPowerTool() {
        super();
        cm = Jetspeed.getComponentManager();
        windowAccess = (PortletWindowAccessor) cm.getComponent(PortletWindowAccessor.class);
    }
    
    public WindowState getWindowState() throws Exception{
      try {
        RequestContext context = Jetspeed.getCurrentRequestContext();
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        return nav.getState(''''windowAccess.getPortletWindow(getCurrentFragment())'''');
      } catch (Exception e) {
        handleError(e, e.toString(), getCurrentFragment());
        return null;
      }
    }
  • No labels