Package org.apache.pluto.om.entity

Examples of org.apache.pluto.om.entity.PortletApplicationEntity


        }

        ObjectID appID =
            org.apache.pluto.portalImpl.util.ObjectID.createFromString(oid.substring(0, dot));

        PortletApplicationEntity appEntity = applications.get(appID);
        if (appEntity == null) {
            LOG.warn("Application not found: " + appID);
            return null;
        }
        PortletEntity portletEntity = appEntity.getPortletEntityList().get(id);
        if (portletEntity == null) {
            LOG.warn("Portlet not found: " + id);
        }

        return portletEntity;
View Full Code Here


     *
     * @see org.apache.pluto.om.entity.PortletApplicationEntityList#get(org.apache.pluto.om.common.ObjectID)
     */
    public PortletApplicationEntity get(ObjectID id) {
        for (Iterator it = applications.iterator(); it.hasNext();) {
            PortletApplicationEntity pae = (PortletApplicationEntity) it.next();
            if (pae.getId().equals(id)) {
                return pae;
            }
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }

    public void add(PortletApplicationEntity e) {
        PortletApplicationEntity old = get(e.getId());
        if (old != null) {
            applications.remove(old);
        }
        applications.add(e);
    }
View Full Code Here

      PortletApplicationEntityListImpl applications = new PortletApplicationEntityListImpl(apps);

        // This is here to set back-references
        for (Iterator iter = applications.iterator(); iter.hasNext();) {
            PortletApplicationEntity app = (PortletApplicationEntity) iter.next();

            for (Iterator ports = app.getPortletEntityList().iterator(); ports.hasNext();) {
                PortletEntityImpl port = (PortletEntityImpl) ports.next();
                if (port.getId().toString().indexOf(".") < 0) {
                    port.setId(app.getId() + "." + port.getId());
                }
                port.setPortletApplicationEntity(app);

            }
        }
View Full Code Here

        }

        ObjectID appID = org.apache.pluto.portalImpl.util.ObjectID.createFromString(oid.substring(
                0, dot));

        PortletApplicationEntity appEntity = applications.get(appID);
        if (appEntity == null) {
            LOG.warn("Application not found: " + appID);
            LOG.warn(toString());
            return null;
        }
        PortletEntity portletEntity = appEntity.getPortletEntityList().get(id);
        if (portletEntity == null) {
            LOG.warn("Portlet not found: " + id);
            LOG.warn(toString());
        }
View Full Code Here

                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationEntity portletAppEntity = portletWindow.getPortletEntity()
                        .getPortletApplicationEntity();
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
View Full Code Here

        final String portletEntityId = (String) getConfiguration(coplet, "portlet");
        if ( this.getLogger().isDebugEnabled() ) {
            this.getLogger().debug("Coplet " + coplet.getId() + " tries to login into portlet " + portletEntityId);
        }

        PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
        PortletEntity portletEntity = ((PortletEntityListImpl)pae.getPortletEntityList()).add(pae, portletEntityId, coplet, registry);

        if ( portletEntity.getPortletDefinition() != null ) {
            // create the window
            PortletWindow portletWindow = new PortletWindowImpl(portletEntityId);               
            ((PortletWindowCtrl)portletWindow).setId(coplet.getId());
            ((PortletWindowCtrl)portletWindow).setPortletEntity(portletEntity);
            PortletWindowList windowList = portletEntity.getPortletWindowList();       
            ((PortletWindowListCtrl)windowList).add(portletWindow);   
            coplet.setTemporaryAttribute("window", portletWindow);

            // load the portlet
            final Map objectModel = ContextHelper.getObjectModel(this.context);
            ServletRequestImpl  req = (ServletRequestImpl) objectModel.get("portlet-request");
            if ( req == null ) {
                final HttpServletResponse res = (HttpServletResponse) objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
                objectModel.put("portlet-response"new ServletResponseImpl(res));
                req = new ServletRequestImpl((HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT), null);
                objectModel.put("portlet-request",  req);               
            }
            final HttpServletResponse res = (HttpServletResponse) objectModel.get("portlet-response");
            try {
                this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow)
                                                  res);
            } catch (Exception e) {
                this.getLogger().error("Error loading portlet " + portletEntityId + " for instance " + coplet.getId(), e);
                // remove portlet entity
                coplet.removeTemporaryAttribute("window");
                ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
            }
        } else {
            this.getLogger().error("Error finding portlet " + portletEntityId + " for instance " + coplet.getId() + " - no definition found.");
        }
    }
View Full Code Here

        PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
        if ( window != null ) {
            coplet.removeTemporaryAttribute("window");
            PortletDefinitionRegistry registry = (PortletDefinitionRegistry) portletContainerEnvironment.getContainerService(PortletDefinitionRegistry.class);

            PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
            ((PortletEntityListImpl)pae.getPortletEntityList()).remove(window.getPortletEntity());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.entity.PortletApplicationEntity

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.