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

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


        return false;
    }

    private boolean isValueInstanceOfDefinedClass(PortletWindow portletWindow, QName qname, Serializable value)
    {
        PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
        List<? extends EventDefinition> events = app.getEventDefinitions();
        if (events != null)
        {
            for (EventDefinition def : events)
            {
                if (def.getValueType() != null)
                {
                    if (def.getQName() != null)
                    {
                        if (def.getQName().equals(qname)) { return value.getClass().getName().equals(def.getValueType()); }
                    }
                    else
                    {
                        QName tmp = new QName(app.getDefaultNamespace(), def.getName());
                        if (tmp.equals(qname)) { return value.getClass().getName().equals(def.getValueType()); }
                    }
                }
            }
        }
View Full Code Here


        this.plutoDescriptorService = plutoDescriptorService;
    }
   
    public PortletApplication read(String name, String contextPath, InputStream webDescriptor, InputStream portletDescriptor, InputStream jetspeedPortletDescriptor, ClassLoader paClassLoader) throws Exception
    {
        PortletApplicationDefinition pad = plutoDescriptorService.read(name, contextPath, portletDescriptor);
        PortletApplication pa = null;
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try
        {
            Thread.currentThread().setContextClassLoader(paClassLoader);
View Full Code Here

      ServletContext servletContext = config.getServletContext();
      String contextPath = getContextPath(servletContext);
        String applicationName = contextPath.substring(1);
        if (!portletContexts.containsKey(applicationName)) {

            PortletApplicationDefinition portletApp = portletRegistry.getPortletAppDD(servletContext, applicationName, contextPath);

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

            portletContexts.put(applicationName, portletContext);

            fireRegistered(portletContext);

            if (LOG.isInfoEnabled()) {
                LOG.info("Registered portlet application for context '/" + applicationName + "'");

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

            classLoaders.put(portletApp.getName(), Thread.currentThread().getContextClassLoader());
            for (PortletDefinition portlet: portletApp.getPortlets()) {
                String appName = portletContext.getApplicationName();
                if (appName == null) {
                    throw new PortletContainerException("Portlet application name should not be null.");
                }
                portletConfigs.put(
View Full Code Here

            final IOException ioe = new IOException(me.getLocalizedMessage());
            ioe.initCause(me);
            throw new IOException(me.getLocalizedMessage());
        }
       
        PortletApplicationDefinition pad = null;
       
        if (app.getValue() instanceof org.apache.pluto.container.om.portlet10.impl.PortletAppType)
        {
             pad = ((org.apache.pluto.container.om.portlet10.impl.PortletAppType)app.getValue()).upgrade();
        }     
        else
        {
            pad = (PortletApplicationDefinition)app.getValue();
        }
       
        pad.setName(name);
        pad.setContextPath(contextPath);
       
        return pad;
    }
View Full Code Here

        String applicationName = appId;
        if (applicationName.length() > 0)
        {
            applicationName = applicationName.substring(1);
        }
        PortletApplicationDefinition portletAppDD = null;

        if (portletRegistry == null)
        {
            return false;
        }

        try
        {
            portletAppDD = portletRegistry.getPortletApplication(applicationName);
        }
        catch (PortletContainerException e)
        {
            StringBuffer errMsg = new StringBuffer("Cannot determine supported window " +
                    "states for portletId [" + portletId + "] and window state [" + state + "].  ");
            String msg = errMsg.append("Unable to access the Portlet Registry Service.").toString();
            LOG.error(msg, e);
        }

        List customWindowStates = portletAppDD.getCustomWindowStates();
        if (customWindowStates != null)
        {
            for (Iterator i = customWindowStates.iterator(); i.hasNext();)
            {
                CustomWindowState customState = (CustomWindowState) i.next();
View Full Code Here

            String applicationName = contextPath;
            if (applicationName.length() >0 )
            {
                applicationName = applicationName.substring(1);
            }
      PortletApplicationDefinition portletAppDD = null;
      try {
        portletAppDD = portletRegistry.getPortletApplication(applicationName);
        List<? extends PortletDefinition> portletDDs = portletAppDD.getPortlets();
        List<QName> aliases = getAllAliases(eventName, portletAppDD);
        for (PortletDefinition portletDD : portletDDs) {
          List<? extends EventDefinitionReference> processingEvents = portletDD.getSupportedProcessingEvents();
          if (isEventSupported(processingEvents, eventName, portletAppDD.getDefaultNamespace())) {
                        if (portletDD.getPortletName().equals(portlet.getPortletName())) {
                                                          resultSet.add(portlet.getId());
                        }
          } else {

            if (processingEvents != null) {
              for (EventDefinitionReference ref : processingEvents) {
                  QName name = ref.getQualifiedName(portletAppDD.getDefaultNamespace());
                  if (name == null)
                  {
                      continue;
                  }
                // add also grouped portlets, that ends with "."
                if (name.toString().endsWith(".")
                    && eventName.toString().startsWith(name.toString())
                    && portletDD.getPortletName().equals(portlet.getPortletName())) {
                  resultSet.add(portlet.getId());
                }
                // also look for alias names:
                if (aliases != null) {
                  for (QName alias : aliases) {
                    if (alias.toString().equals(name.toString())
                        && portletDD.getPortletName().equals(portlet.getPortletName())) {
                      resultSet.add(portlet.getId());
                    }
                  }
                }
                // also look for default namespaced events
                if (name.getNamespaceURI() == null || name.getNamespaceURI().equals("")) {
                  String defaultNamespace = portletAppDD.getDefaultNamespace();
                  QName qname = new QName(defaultNamespace, name.getLocalPart());
                  if (eventName.toString().equals(qname.toString())
                      && portletDD.getPortletName().equals(portlet.getPortletName())) {
                    resultSet.add(portlet.getId());
                  }
View Full Code Here

            if (portletRegistry == null)
            {
                LOG.error("Optional Portlet Registry Service not found.");
                throw new PortletContainerException("Optional Portlet Registry Service not found.");
            }
            PortletApplicationDefinition ctx = portletRegistry.getPortletApplication(applicationName);
            Iterator i = ctx.getPortlets().iterator();
            while (i.hasNext())
            {
                PortletDefinition dd = (PortletDefinition) i.next();
                if (portletName.equals(dd.getPortletName()))
                {
View Full Code Here

        {
            applicationName = applicationName.substring(1);
        }
        try
        {
            PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
            Iterator customModes = portletApp.getCustomPortletModes().iterator();
            while (customModes.hasNext())
            {
                CustomPortletModeType customMode = (CustomPortletModeType) customModes.next();
                boolean isPortletManagedMode = !customMode.isPortalManaged();
                if (isPortletManagedMode && customMode.getPortletMode().equalsIgnoreCase(mode))
View Full Code Here

        if (portletRegistry == null)
        {
            LOG.error("Optional Portlet Registry Service not found.");
            throw new PortletContainerException("Optional Portlet Registry Service not found.");
        }
        PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
        Iterator i = portletApp.getPortlets().iterator();
        while (i.hasNext())
        {
            PortletDefinition dd = (PortletDefinition) i.next();
            if (portletName.equals(dd.getPortletName()))
            {
View Full Code Here

        return false;
    }

    private boolean isValueInstanceOfDefinedClass(QName qname, Serializable value)
    {
        PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
        List<? extends EventDefinition> events = app.getEventDefinitions();
        if (events != null)
        {
            for (EventDefinition def : events)
            {
                if (def.getQName() != null)
                {
                    if (def.getQName().equals(qname))
                    {
                        return value.getClass().getName().equals(def.getValueType());
                    }
                }
                else
                {
                    QName tmp = new QName(app.getDefaultNamespace(), def.getName());
                    if (tmp.equals(qname))
                    {
                        return value.getClass().getName().equals(def.getValueType());
                    }
                }
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.