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

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


    public EventProviderImpl(IPortletWindow portletWindow, PortletContextService portletContextService) {
        this.portletWindow = portletWindow;
       
        final PortletDefinition portletDefinition = portletWindow.getPlutoPortletWindow().getPortletDefinition();
        final PortletApplicationDefinition application = portletDefinition.getApplication();
        final String portletApplicationName = application.getName();
        try {
            this.portletClassLoader = portletContextService.getClassLoader(portletApplicationName);
        }
        catch (PortletContainerException e) {
            throw new IllegalStateException("Failed to find ClassLoader for portlet applicaiton: " + portletApplicationName, e);
View Full Code Here


       
        if (events == null) {
            return false;
        }
       
        final PortletApplicationDefinition application = portletDescriptor.getApplication();
        final String defaultNamespace = application.getDefaultNamespace();
        for (final EventDefinitionReference ref : events) {
            final QName name = ref.getQualifiedName(defaultNamespace);
            if (name == null) {
                continue;
            }
View Full Code Here

        return false;
    }

    private boolean isValueInstanceOfDefinedClass(QName qname, Serializable value) {
        final PortletDefinition portletDefinition = this.portletWindow.getPlutoPortletWindow().getPortletDefinition();
        final PortletApplicationDefinition app = portletDefinition.getApplication();
        final List<? extends EventDefinition> events = app.getEventDefinitions();
        if (events == null) {
            return true;
        }
       
        final String defaultNamespace = app.getDefaultNamespace();
       
        for (final EventDefinition eventDefinition : events) {
            if (eventDefinition.getQName() != null) {
                if (eventDefinition.getQName().equals(qname)) {
                    final Class<? extends Serializable> valueClass = value.getClass();
View Full Code Here

     * @throws PortletContainerException If expected attributes cannot be determined
     */
    protected List<? extends UserAttribute> getExpectedUserAttributes(HttpServletRequest request, final IPortletWindow portletWindow) throws PortletContainerException {
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
        final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
       
        return portletApplicationDescriptor.getUserAttributes();
    }
View Full Code Here

      // get the list of requested user attributes
        final HttpServletRequest httpServletRequest = this.portalRequestUtils.getPortletHttpRequest(request);
        final IPortletWindow portletWindow = this.portletWindowRegistry.convertPortletWindow(httpServletRequest, plutoPortletWindow);
        final IPortletEntity portletEntity = portletWindow.getPortletEntity();
        final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
        final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());
       
        // check to see if the proxy ticket key is one of the requested user attributes
        List<? extends UserAttribute> requestedUserAttributes = portletApplicationDescriptor.getUserAttributes();
        for (final UserAttribute userAttributeDD : requestedUserAttributes) {
            final String attributeName = userAttributeDD.getName();
            if (attributeName.equals(this.proxyTicketKey))
              return true;
        }
View Full Code Here

   * @return The List of expected user attributes for the portlet
   */
  protected List<? extends UserAttribute> getExpectedUserAttributes(HttpServletRequest request, final IPortletWindow portletWindow) {
    final IPortletEntity portletEntity = portletWindow.getPortletEntity();
    final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition();
    final PortletApplicationDefinition portletApplicationDescriptor = this.portletDefinitionRegistry.getParentPortletApplicationDescriptor(portletDefinition.getPortletDefinitionId());

    return portletApplicationDescriptor.getUserAttributes();
  }
View Full Code Here

    public synchronized String register(ServletConfig config) throws PortletContainerException {
        ServletContext servletContext = config.getServletContext();
        String contextPath = servletContext.getContextPath();
        if (!portletContexts.containsKey(contextPath)) {

            PortletApplicationDefinition portletApp = this
                    .getPortletAppDD(servletContext, contextPath, contextPath);

            DriverPortletContext portletContext = new DriverPortletContextImpl(servletContext, portletApp,
                    requestDispatcherService);

            portletContext.setAttribute(PlatformApiBroker.PORTLET_CONTEXT_ATTRIBUTE_NAME,platformApiBroker);
            portletContexts.put(contextPath, portletContext);

            fireRegistered(portletContext);

            if (logger.isInfoEnabled()) {
                logger.info("Registered portlet application for context '" + contextPath + "'");

                logger.info("Registering " + portletApp.getPortlets().size() + " portlets for context "
                        + portletContext.getApplicationName());
            }

            //TODO have the portlet servlet provide the portlet's classloader as parameter to this method
            //This approach is needed as all pluto callbacks in uPortal have an aspect that switches the thread classloader back
            //to uPortal's classloader.
            ClassLoader classLoader = ThreadContextClassLoaderAspect.getPreviousClassLoader();
            if (classLoader == null) {
                classLoader = Thread.currentThread().getContextClassLoader();
            }
            classLoaders.put(portletApp.getName(), classLoader);
            for (PortletDefinition portlet : portletApp.getPortlets()) {
                String appName = portletContext.getApplicationName();
                if (appName == null) {
                    throw new PortletContainerException("Portlet application name should not be null.");
                }
                portletConfigs.put(portletContext.getApplicationName() + "/" + portlet.getPortletName(),
View Full Code Here

     * @return The portlet application deployment descriptor.
     * @throws PortletContainerException if the descriptor can not be found or parsed
     */
    public synchronized PortletApplicationDefinition getPortletAppDD(ServletContext servletContext, String name, String contextPath)
            throws PortletContainerException {
        PortletApplicationDefinition portletApp = this.portletAppDefinitionCache.get(servletContext);
        if (portletApp == null) {
            portletApp = createDefinition(servletContext, name, contextPath);
            this.portletAppDefinitionCache.put(servletContext, portletApp);
        }
        return portletApp;
View Full Code Here

     * @return the Portlet Application Deployment Descriptor.
     * @throws PortletContainerException
     */
    private PortletApplicationDefinition createDefinition(ServletContext servletContext, String name, String contextPath)
            throws PortletContainerException {
        PortletApplicationDefinition portletApp = null;
        try {
            InputStream paIn = servletContext.getResourceAsStream(PORTLET_XML);
            InputStream webIn = servletContext.getResourceAsStream(WEB_XML);
            if (paIn == null) {
                throw new PortletContainerException("Cannot find '" + PORTLET_XML
View Full Code Here

        assertNotNull(this.registry);
    }

    public void testEntities() throws Exception
    {
        PortletApplicationDefinition pa = registry.getPortletApplication(TEST_APP);
        assertNotNull("Portlet Application", pa);
        System.out.println("pa = " + pa.getName());
        List<PortletDefinition> portlets = (List<PortletDefinition>) pa.getPortlets(); // .get(JetspeedObjectID.createFromString(TEST_PORTLET));
        Iterator pi = portlets.iterator();
        PortletDefinition pd = null;
        while (pi.hasNext())
        {
            pd = (PortletDefinition) pi.next();
View Full Code Here

TOP

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

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.