1 2 package org.roller.presentation.velocity; 3 import java.util.ArrayList ; 4 import java.util.List ; 5 import org.roller.model.PlanetManager; 6 import org.roller.model.Roller; 7 import org.roller.pojos.PlanetGroupData; 8 import org.roller.pojos.PlanetSubscriptionData; 9 import org.roller.presentation.RollerRequest; 10 import org.roller.presentation.velocity.PageModel; 11 12 18 public class PlanetPageModel extends PageModel 19 { 20 PlanetManager planetManager = null; 21 public void init(RollerRequest rreq) 22 { 23 super.init(rreq); 24 try 25 { 26 planetManager = rreq.getRoller().getPlanetManager(); 27 } 28 catch (Exception e) 29 { 30 mLogger.error("ERROR initializing page model",e); 31 } 32 } 33 37 public List getPlanetAggregation(int max) throws Exception 38 { 39 return planetManager.getAggregation(max); 40 } 41 45 public List getPlanetAggregation(String groupHandle, int max) throws Exception 46 { 47 List list = new ArrayList (); 48 PlanetGroupData group = planetManager.getGroup(groupHandle); 49 if (group != null) 50 { 51 list = planetManager.getAggregation(group, max); 52 } 53 return list; 54 } 55 59 public List getPlanetSubscriptionEntries(String feedUrl, int max) throws Exception 60 { 61 List list = new ArrayList (); 62 PlanetSubscriptionData sub = planetManager.getSubscription(feedUrl); 63 if (sub != null) 64 { 65 list = sub.getEntries(); 66 } 67 return list; 68 } 69 } 70 | Popular Tags |