1 16 package org.apache.cocoon.portal.pluto.om; 17 18 import java.util.HashMap ; 19 import java.util.Iterator ; 20 import java.util.Map ; 21 22 import org.apache.pluto.om.common.ObjectID; 23 import org.apache.pluto.om.entity.PortletApplicationEntity; 24 import org.apache.pluto.om.entity.PortletApplicationEntityList; 25 import org.apache.pluto.om.entity.PortletApplicationEntityListCtrl; 26 import org.apache.pluto.om.portlet.PortletApplicationDefinition; 27 import org.apache.pluto.om.portlet.PortletApplicationDefinitionList; 28 29 36 public class PortletApplicationEntityListImpl 37 implements PortletApplicationEntityList, PortletApplicationEntityListCtrl { 38 39 40 protected Map portletApplicationEntities = new HashMap (); 41 42 43 protected PortletDefinitionRegistry registry; 44 45 48 public PortletApplicationEntityListImpl(PortletDefinitionRegistry pdr) { 49 this.registry = pdr; 50 } 51 52 55 public Iterator iterator() { 56 return this.portletApplicationEntities.values().iterator(); 57 } 58 59 62 public PortletApplicationEntity add(String definitionId) { 63 PortletApplicationDefinitionList padl = this.registry.getPortletApplicationDefinitionList(); 64 PortletApplicationDefinition pad = padl.get(org.apache.cocoon.portal.pluto.om.common.ObjectIDImpl.createFromString(definitionId)); 65 PortletApplicationEntityImpl pae = new PortletApplicationEntityImpl(definitionId, pad); 66 this.portletApplicationEntities.put(pae.getId(), pae); 67 return pae; 68 } 69 70 73 public PortletApplicationEntity get(ObjectID objectId) { 74 final PortletApplicationEntity pae = (PortletApplicationEntity) this.portletApplicationEntities.get(objectId); 75 return pae; 76 } 77 78 } 79 | Popular Tags |