Package org.apache.pluto.om.entity

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


            // fill portletEntitiesKeyObjectID
            Iterator portlets = appInst.getPortletEntityList().iterator();
            while (portlets.hasNext())
            {
                PortletEntity portletInst = (PortletEntity)portlets.next();                               
                portletEntitiesKeyObjectID.put(portletInst.getId().toString(), portletInst);

            }

        }
View Full Code Here


   *            the name of the role
   * @return true if it is determined the user has the given role.
   * 
   */
  public boolean isUserInRole(String roleName) {
    PortletEntity entity = portletWindow.getPortletEntity();
    PortletDefinition def = entity.getPortletDefinition();
    SecurityRoleRefSet set = def.getInitSecurityRoleRefSet();
    SecurityRoleRef ref = set.get(roleName);

    String link = null;
    if (ref != null && ref.getRoleLink() != null) {
View Full Code Here

                if ( !found ) {
                    log("Portlet Application "+appName+" not found!");
                    throw new ServletException("Portlet Application "+appName+" not found!");
                }
                portletIt = appEntity.getPortletEntityList().iterator();
                PortletEntity portlet = null;
                // search for portlet
                found = false;
                while ( portletIt.hasNext() && ! found ) {
                    portlet = (PortletEntity) portletIt.next();
                    PortletDefinition tmpPortletDef = portlet.getPortletDefinition();
                    if ( tmpPortletDef == null ) {
                      log("ERROR: Portlet definition of portlet enity (id="+portlet.getId()+") not found!");
                      log("       Portlet may not be defined in portlet.xml!");
                      throw new ServletException("Portlet definition of portlet enity (id="+portlet.getId()+") not found!");
                  }
                    String tmpPortletName = tmpPortletDef.getName();
                    //delete all existing preferences for this portlet entity
                    if (tmpPortletName != null && tmpPortletName.equals(portletName)) {
                        for (Iterator iter = portlet.getPreferenceSet().iterator(); iter.hasNext();) {
                            iter.next();
                            iter.remove();
                        }
                        found = true;
                    }
                }
                if (!found) {
                    for (Iterator appIter = definitionList.iterator(); !found && appIter.hasNext();) {
                        PortletApplicationDefinition appDef = (PortletApplicationDefinition)appIter.next();
                        if (appDef.getId().toString().equals(appName)) {
                            for (Iterator portletIter = appDef.getPortletDefinitionList().iterator(); !found && portletIter.hasNext();) {
                                PortletDefinition portletDef = (PortletDefinition)portletIter.next();
                                if (portletDef.getId().toString().equals(appName + "." + portletName)) {
                                    //PortletEntityListCtrl entityListCtrl = (PortletEntityListCtrl)ControllerObjectAccess.get(appEntity.getPortletEntityList());
                                    PortletEntityListCtrl entityListCtrl = (PortletEntityListCtrl)appEntity.getPortletEntityList();
                                    portlet = entityListCtrl.add(appEntity, portletDef.getId().toString());
                                    PortletEntityRegistry.refresh(portlet);
                                    log("added Portlet " + portletName + " to PortletEntityRegistry");
                                    found = true;
                                }
                            }
                        }
                    }
                }
                if ( ! found ) {
                    log("ERROR: Portlet "+portletName+" not found!");
                    throw new ServletException("Portlet "+portletName+" not found!");
                }
                FragmentImpl tckPortlet = new FragmentImpl();
                tckPortlet.setType("portlet");
                tckPortlet.setName("p"+windowNo++);   // set portlet
                // property
                PropertyImpl property = new PropertyImpl();
                property.setName("portlet");
                property.setValue(portlet.getId().toString());
                tckPortlet.getProperties().add(property);
                fragments.add(tckPortlet);
            }
            FragmentImpl tckCol = new FragmentImpl();
            tckCol.setType("column");
View Full Code Here

    public PortletEntity get(ObjectID objectId)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            PortletEntity portletEntity = (PortletEntity)iterator.next();
            if (portletEntity.getId().equals(objectId)) {
                return portletEntity;
            }
        }
        return null;
    }
View Full Code Here

   
    public PortletEntity get(String objectId)
    {
        Iterator iterator = this.iterator();
        while (iterator.hasNext()) {
            PortletEntity portletEntity = (PortletEntity)iterator.next();
            if (portletEntity.getId().equals(objectId)) {
                return portletEntity;
            }
        }
        return null;
    }
View Full Code Here

        PortletDefinitionRegistry registry = (PortletDefinitionRegistry) portletContainerEnvironment.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);
View Full Code Here

        // 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, registry.getPortalService());
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
    }
View Full Code Here

    public PortletEntity add(PortletApplicationEntity appEntity,
                             String definitionId,
                             CopletInstanceData coplet,
                             PortletDefinitionRegistry registry) {
        PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
        PortletEntity portletEntity = new PortletEntityImpl(appEntity, coplet, pd, registry.getPortalService());
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
    }
View Full Code Here

        // 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, registry.getPortalService());
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
    }
View Full Code Here

    public PortletEntity add(PortletApplicationEntity appEntity,
                             String definitionId,
                             CopletInstanceData coplet,
                             PortletDefinitionRegistry registry) {
        PortletDefinition pd = registry.getPortletDefinition(ObjectIDImpl.createFromString(definitionId));
        PortletEntity portletEntity = new PortletEntityImpl(appEntity, coplet, pd, registry.getPortalService());
        this.portlets.put(portletEntity.getId(), portletEntity);
       
        return portletEntity;
    }
View Full Code Here

TOP

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

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.