1 16 package org.apache.jetspeed.modules.actions.portlets; 17 18 import java.util.ArrayList ; 19 import java.util.Iterator ; 20 import java.util.List ; 21 22 import org.apache.jetspeed.om.registry.MediaTypeRegistry; 23 import org.apache.jetspeed.portal.Portlet; 24 import org.apache.jetspeed.services.Registry; 25 import org.apache.jetspeed.util.PortletSessionState; 26 import org.apache.turbine.util.RunData; 27 import org.apache.velocity.context.Context; 28 29 36 public class PortletBrowseAction extends RegistryBrowseAction 37 { 38 42 49 protected void buildNormalContext( 50 Portlet portlet, 51 Context context, 52 RunData rundata) 53 { 54 super.buildNormalContext(portlet, context, rundata); 55 56 List portlets = 57 (List ) PortletSessionState.getAttribute(portlet, rundata, RESULTS); 58 59 List categories = PortletFilter.buildCategoryList(portlets); 60 context.put("categories", categories); 61 62 MediaTypeRegistry mediaTypeReg = 63 (MediaTypeRegistry) Registry.get(Registry.MEDIA_TYPE); 64 65 ArrayList collection = new ArrayList (); 66 Iterator iter = mediaTypeReg.listEntryNames(); 67 while (iter.hasNext()) 68 { 69 collection.add(iter.next()); 70 } 71 72 context.put("media_types", collection); 73 74 context.put("parents", PortletFilter.buildParentList(portlets)); 75 } 76 77 82 protected List filter(List entries, String [] fields, String [] values) 83 { 84 return PortletFilter.filterPortlets(entries, fields, values); 85 } 86 } 87 | Popular Tags |