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;
}
}