Package org.apache.pluto.om.entity

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


     */
    public PortletEntity add(PortletApplicationEntity appEntity, String definitionId) {
        // FIXME
        PortletDefinitionRegistry registry = null;
        PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
        PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
        CopletInstanceData coplet = null;
        PortletEntity portletEntity = new PortletEntityImpl(pae, coplet, pd);
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
View Full Code Here


        }
        PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
       
        final String portletEntityId = (String) getConfiguration(coplet, "portlet");  
       
        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");
            PortletPortalManager.copletInstanceData.set(coplet);
            try {
                this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow)
                                                  res);
            } catch (Exception e) {
                this.getLogger().error("Error loading portlet " + portletEntityId, e);
                // remove portlet entity
                coplet.removeTemporaryAttribute("window");
                ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
            } finally {
                PortletPortalManager.copletInstanceData.set(null);
            }
        }
    }
View Full Code Here

        PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
        if ( window != null ) {
            coplet.removeTemporaryAttribute("window");
            PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
       
            PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
            ((PortletEntityListImpl)pae.getPortletEntityList()).remove(window.getPortletEntity());
        }
    }
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

     */
    public PortletEntity add(PortletApplicationEntity appEntity, String definitionId) {
        // FIXME
        PortletDefinitionRegistry registry = null;
        PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
        PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
        CopletInstanceData coplet = null;
        PortletEntity portletEntity = new PortletEntityImpl(pae, coplet, pd);
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.pluto.om.entity.PortletApplicationEntityList#get(org.apache.pluto.om.common.ObjectID)
     */
    public PortletApplicationEntity get(ObjectID objectId) {
        final PortletApplicationEntity pae = (PortletApplicationEntity) this.portletApplicationEntities.get(objectId);
        return pae;
    }
View Full Code Here

        }
        PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
       
        final String portletEntityId = (String) getConfiguration(coplet, "portlet");  
       
        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.setAttribute("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");
            PortletPortalManager.copletInstanceData.set(coplet);
            try {
                this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow)
                                                  res);
            } catch (Exception e) {
                this.getLogger().error("Error loading portlet " + portletEntityId, e);
                // remove portlet entity
                coplet.removeAttribute("window");
                ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
            } finally {
                PortletPortalManager.copletInstanceData.set(null);
            }
        }
    }
View Full Code Here

        PortletWindow window = (PortletWindow)coplet.getAttribute("window");
        if ( window != null ) {
            coplet.removeAttribute("window");
            PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
       
            PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
            ((PortletEntityListImpl)pae.getPortletEntityList()).remove(window.getPortletEntity());
        }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.pluto.om.entity.PortletApplicationEntityList#get(org.apache.pluto.om.common.ObjectID)
     */
    public PortletApplicationEntity get(ObjectID objectId) {
        final PortletApplicationEntity pae = (PortletApplicationEntity) this.portletApplicationEntities.get(objectId);
        return pae;
    }
View Full Code Here

        PortletDefinitionRegistry registry = (PortletDefinitionRegistry) environment.getContainerService(PortletDefinitionRegistry.class);
       
        final String portletEntityId = (String) getConfiguration(coplet, "portlet");  
       
        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.setAttribute("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");
            PortletPortalManager.copletInstanceData.set(coplet);
            try {
                this.portletContainer.portletLoad(portletWindow, req.getRequest(portletWindow)
                                                  res);
            } catch (Exception e) {
                this.getLogger().error("Error loading portlet " + portletEntityId, e);
                // remove portlet entity
                coplet.removeAttribute("window");
                ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
            } finally {
                PortletPortalManager.copletInstanceData.set(null);
            }
        }
    }
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.