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

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


        }
    }
   
    public PortletApplicationDefinition upgrade()
    {
        PortletApplicationDefinition app = new org.apache.pluto.container.om.portlet.impl.PortletAppType();
        app.setVersion(version);
        if (portlet != null)
        {
            for (PortletType src : portlet)
            {
                PortletDefinition target = app.addPortlet(src.portletName);
                upgradePortlet(src, target);
            }
        }
        if (customPortletMode != null)
        {
            for (CustomPortletModeType src : customPortletMode)
            {
                CustomPortletMode target = app.addCustomPortletMode(src.portletMode);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (customWindowState != null)
        {
            for (CustomWindowStateType src : customWindowState)
            {
                CustomWindowState target = app.addCustomWindowState(src.windowState);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (userAttribute != null)
        {
            for (UserAttributeType src : userAttribute)
            {
                UserAttribute target = app.addUserAttribute(src.name);
                if (src.description != null)
                {
                    for (DescriptionType d : src.description)
                    {
                        Description desc = target.addDescription(d.lang);
                        desc.setDescription(d.value);
                    }
                }
            }
        }
        if (securityConstraint != null)
        {
            for (SecurityConstraintType src : securityConstraint)
            {
                SecurityConstraint target = app.addSecurityConstraint(src.userDataConstraint.transportGuarantee);
                if (src.displayName != null)
                {
                    for (DisplayNameType d : src.displayName)
                    {
                        DisplayName dname = target.addDisplayName(d.lang);
View Full Code Here


        LOG.warn(e.getMessage(),e);
     
    }

  private EventDefinition getEventDefintion(PortletWindow portletWindow, QName name) {
    PortletApplicationDefinition appDD = portletWindow.getPortletDefinition().getApplication();
    for (EventDefinition def : appDD.getEventDefinitions()){
      if (def.getQName() != null){
        if (def.getQName().equals(name))
          return def;
      }
      else{
        QName tmp = new QName(appDD.getDefaultNamespace(),def.getName());
        if (tmp.equals(name))
          return def;
      }
    }
    throw new IllegalStateException();
View Full Code Here

    Collection<PortletWindowConfig> portlets = getAllPortlets(driverConfig);

    for (PortletWindowConfig portlet : portlets) {
      String contextPath = portlet.getContextPath();
            String applicationName = contextPath;
      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

        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

            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

        String applicationName = appId;
        if (applicationName.length() >0 )
        {
            applicationName = applicationName.substring(1);
        }
        PortletApplicationDefinition portletAppDD = null;
       
        if (portletRegistry == null)
        {                       
            portletRegistry = getPortletRegistryService();
            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

        catch(Exception me) {
            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

        try {
            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())) {
                    Iterator i2 = dd.getSupports().iterator();
                    while(i2.hasNext()) {
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.