1 23 package org.infoglue.cms.applications.managementtool.actions; 24 25 import java.io.InputStream ; 26 import java.util.Hashtable ; 27 import java.util.Iterator ; 28 import java.util.Map ; 29 import java.util.Vector ; 30 31 import org.apache.pluto.om.entity.PortletApplicationEntity; 32 import org.apache.pluto.om.entity.PortletApplicationEntityList; 33 import org.apache.pluto.om.entity.PortletEntity; 34 import org.apache.pluto.portalImpl.services.portletentityregistry.PortletEntityRegistry; 35 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 36 import org.infoglue.cms.controllers.kernel.impl.simple.PortletAssetController; 37 import org.infoglue.cms.entities.content.DigitalAsset; 38 import org.infoglue.cms.io.FileHelper; 39 40 44 public class ViewListPortletAction extends InfoGlueAbstractAction 45 { 46 private static final long serialVersionUID = 1L; 47 48 private Hashtable portlets = new Hashtable (); 49 private String portletRegistry; 50 51 protected String doExecute() throws Exception 52 { 53 PortletApplicationEntityList pael = PortletEntityRegistry.getPortletApplicationEntityList(); 54 55 for(Iterator it = pael.iterator(); it.hasNext();) { 56 PortletApplicationEntity pae = (PortletApplicationEntity) it.next(); 57 String app = pae.getId().toString(); 58 59 Vector list = new Vector (); 60 for(Iterator it2 = pae.getPortletEntityList().iterator(); it2.hasNext();) { 61 PortletEntity pe = (PortletEntity) it2.next(); 62 list.add(pe.getId().toString()); 63 } 64 portlets.put(app, list); 65 } 66 67 return "success"; 68 } 69 70 public String doSimple() throws Exception 71 { 72 DigitalAsset digitalAsset = PortletAssetController.getPortletAssetController().getPortletRegistryAsset(); 73 InputStream is = digitalAsset.getAssetBlob(); 74 75 portletRegistry = FileHelper.getStreamAsString(is); 76 77 return "successSimple"; 78 } 79 80 81 public Map getPortlets() 82 { 83 return this.portlets; 84 } 85 86 public String getPortletRegistry() { 87 return portletRegistry; 88 } 89 90 } 91 | Popular Tags |