Package org.apache.pluto.container.om.portlet

Examples of org.apache.pluto.container.om.portlet.PortletDefinition


        }
        PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
        Iterator i = portletApp.getPortlets().iterator();
        while (i.hasNext())
        {
            PortletDefinition dd = (PortletDefinition) i.next();
            if (portletName.equals(dd.getPortletName()))
            {
                Iterator i2 = dd.getSupports().iterator();
                while (i2.hasNext())
                {
                    Supports sd = (Supports) i2.next();
                    if (sd.getPortletModes() == null)
                    {
View Full Code Here


    private PortletApplicationDefinition portletApp;
    private String portletName;
    private String lifeCycle;

    public FilterManagerImpl(PortletWindow portletWindow, String lifeCycle) {
        final PortletDefinition pd = portletWindow.getPortletDefinition();
        this.portletApp = pd.getApplication();
        this.portletName =  pd.getPortletName();
        this.lifeCycle = lifeCycle;
        filterchain = new FilterChainImpl(lifeCycle);
        initFilterChain();
    }
View Full Code Here

            {
                context.log(ex.getMessage(),ex);
                return true;
            }

            PortletDefinition portletDD = portletConfig.getPortletDefinition();

            //          Create and initialize the portlet wrapped in the servlet.
            try
            {
                Class<?> clazz = paClassLoader.loadClass((portletDD.getPortletClass()));
                portlet = (Portlet) clazz.newInstance();
                portlet.init(portletConfig);
                initializeEventPortlet();
                initializeResourceServingPortlet();
                return true;
View Full Code Here

  public void testDetermineCacheScopePortletDefinitionPrivate() {
    MockHttpServletRequest httpRequest = new MockHttpServletRequest();
    MockPortletWindowId portletWindowId = new MockPortletWindowId("123");
    MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId(789);
   
    PortletDefinition portletDefinition = mock(PortletDefinition.class);
    when(portletDefinition.getCacheScope()).thenReturn("private");
   
    when(portletWindowRegistry.getPortletWindow(httpRequest, portletWindowId)).thenReturn(portletWindow);
    when(portletWindow.getPortletWindowId()).thenReturn(portletWindowId);
        when(portletWindow.getPortletEntity()).thenReturn(portletEntity);
        when(portletWindow.getWindowState()).thenReturn(WindowState.NORMAL);
View Full Code Here

        //org.jasig.portal.search.SearchQuery
       
        final Event event = mock(Event.class);
        final MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId(1);
        final PortletApplicationDefinition portletApplicationDefinition = mock(PortletApplicationDefinition.class);
        final PortletDefinition portletDefinition = mock(PortletDefinition.class);
        final EventDefinitionReference searchRequestEventDefinitionReference = mock(EventDefinitionReference.class);
        final EventDefinitionReference searchResultsEventDefinitionReference = mock(EventDefinitionReference.class);
        final EventDefinition searchRequestEventDefinition = mock(EventDefinition.class);
        final EventDefinition searchResultsEventDefinition = mock(EventDefinition.class);
       
        when(event.getQName()).thenReturn(searchRequestName);
       
        when(searchRequestEventDefinitionReference.getQualifiedName(anyString())).thenReturn(searchRequestName);
        when(searchRequestEventDefinitionReference.getQName()).thenReturn(searchRequestName);
       
        when(searchResultsEventDefinitionReference.getQualifiedName(anyString())).thenReturn(searchResultsName);
        when(searchResultsEventDefinitionReference.getQName()).thenReturn(searchResultsName);
       
        when(searchRequestEventDefinition.getQName()).thenReturn(searchRequestName);
        when(searchRequestEventDefinition.getQualifiedName(anyString())).thenReturn(searchRequestName);
       
        when(searchResultsEventDefinition.getQName()).thenReturn(searchResultsName);
        when(searchResultsEventDefinition.getQualifiedName(anyString())).thenReturn(searchResultsName);


        when(this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinitionId)).thenReturn(portletApplicationDefinition);
        when(this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId)).thenReturn(portletDefinition);
       
        final List<? extends EventDefinition> eventDefinitions = Arrays.asList(searchRequestEventDefinition, searchResultsEventDefinition);
        when(portletApplicationDefinition.getEventDefinitions()).thenReturn((List) eventDefinitions);
       
        final List<? extends EventDefinitionReference> supportedProcessingEvents = Collections.singletonList(searchRequestEventDefinitionReference);
        when(portletDefinition.getSupportedProcessingEvents()).thenReturn((List) supportedProcessingEvents);
       
        final boolean supportsEvent = portletEventCoordinatationService.supportsEvent(event, portletDefinitionId);
        assertTrue(supportsEvent);
    }
View Full Code Here

      }
      final String portletAppId = portletDescriptorKeys.first;
      final String portletName = portletDescriptorKeys.second;
     
        final PortletRegistryService portletRegistryService = this.portalDriverContainerServices.getPortletRegistryService();
        final PortletDefinition portletDescriptor;
        try {
            portletDescriptor = portletRegistryService.getPortlet(portletAppId, portletName);
        }
        catch (PortletContainerException e) {
            this.logger.warn("Failed to load portlet descriptor for appId='" + portletAppId + "', portletName='" + portletName + "'", e);
            return false;
        }
       
        if (portletDescriptor == null) {
            return false;
        }
       
        //Iterate over supported portlet modes, this ignores the content types for now
        final List<? extends Supports> supports = portletDescriptor.getSupports();
        for (final Supports support : supports) {
            final List<String> portletModes = support.getPortletModes();
            for (final String portletMode : portletModes) {
                if (IPortletRenderer.CONFIG.equals(PortletUtils.getPortletMode(portletMode))) {
                    return true;
View Full Code Here

        final String portletName = portletDescriptorKeys.second;

   
    final PortletRegistryService portletRegistryService = portalDriverContainerServices.getPortletRegistryService();
    try {
      PortletDefinition portletDD = portletRegistryService.getPortlet(portletAppId, portletName);
      return portletDD;
    } catch (PortletContainerException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

        // appName/portletName must be set at this point
        Validate.notBlank(form.getApplicationId(), "ApplicationId not set");
        Validate.notBlank(form.getPortletName(), "PortletName not set");

        final PortletRegistryService portletRegistryService = portalDriverContainerServices.getPortletRegistryService();
        final PortletDefinition portletDef;
        try {
            portletDef = portletRegistryService.getPortlet(form.getApplicationId(), form.getPortletName());
        }
        catch (PortletContainerException e) {
            this.logger.warn("Failed to load portlet descriptor for appId='" + form.getApplicationId() + "', portletName='" + form.getPortletName() + "'", e);
            return;
        }

        form.setTitle(portletDef.getPortletName());
        form.setName(portletDef.getPortletName());
        for (Supports supports : portletDef.getSupports()) {
            for (String mode : supports.getPortletModes()) {
                if ("edit".equalsIgnoreCase(mode)) {
                    form.setEditable(true);
                } else if ("help".equalsIgnoreCase(mode)) {
                    form.setHasHelp(true);
View Full Code Here

    private PortletApplicationDefinition portletApp;
    private String portletName;
    private String lifeCycle;

    public FilterManagerImpl(PortletWindow portletWindow, String lifeCycle) {
        final PortletDefinition pd = portletWindow.getPortletDefinition();
        this.portletApp = pd.getApplication();
        this.portletName = pd.getPortletName();
        this.lifeCycle = lifeCycle;
        filterchain = new FilterChainImpl(lifeCycle);
        initFilterChain();
    }
View Full Code Here

                      layoutNodeIdItr.remove();
                      continue;
                    }
                   
                    final IPortletDefinitionId portletDefinitionId = portletEntity.getPortletDefinitionId();
                    final PortletDefinition portletDescriptor = this.portletDefinitionRegistry.getParentPortletDescriptor(portletDefinitionId);
                    if (portletDescriptor == null) {
                        //Missconfigured portlet, remove it from the list so we don't check again and ignore it
                        layoutNodeIdItr.remove();
                        continue;
                    }
                   
                    final List<? extends EventDefinitionReference> supportedProcessingEvents = portletDescriptor.getSupportedProcessingEvents();
                    //Skip portlets that don't handle any events and remove them from the set so they are not checked again
                    if (supportedProcessingEvents == null || supportedProcessingEvents.size() == 0) {
                        layoutNodeIdItr.remove();
                        continue;
                    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.container.om.portlet.PortletDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.