1 16 17 package org.apache.jetspeed.modules.actions.portlets; 18 19 import java.util.Iterator ; 21 import java.util.Collection ; 22 import java.util.ArrayList ; 23 24 import org.apache.turbine.util.RunData; 26 import org.apache.jetspeed.services.search.Search; 27 28 import org.apache.jetspeed.om.registry.PortletEntry; 30 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 31 import org.apache.jetspeed.services.logging.JetspeedLogger; 32 import org.apache.jetspeed.services.Registry; 33 import org.apache.jetspeed.portal.Portlet; 34 35 36 42 public class IndexPortletRegistry extends SecureGenericMVCAction 43 { 44 45 48 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(IndexPortletRegistry.class.getName()); 49 50 56 protected void buildNormalContext(Portlet portlet, RunData rundata) 57 { 58 } 60 61 67 public void doIndex(RunData rundata, Portlet portlet) 68 { 69 if (portlet == null) 70 { 71 return; 72 } 73 74 Collection c = new ArrayList (); 75 76 for (Iterator i = Registry.get(Registry.PORTLET).listEntryNames(); i.hasNext();) 77 { 78 PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, (String ) i.next()); 79 if (!entry.getType().equals(PortletEntry.TYPE_ABSTRACT) && !entry.isHidden()) 80 { 81 c.add(entry); 82 } 84 } 85 86 try 87 { 88 Search.remove(c); 90 } 91 catch (Throwable e) 92 { 93 logger.error("Throwable", e); 94 } 95 96 try 97 { 98 Search.add(c); 100 } 101 catch (Throwable e) 102 { 103 logger.error("Throwable", e); 104 } 105 } 106 107 } 108 | Popular Tags |