| 1 package com.geinuke.bizlogic; 2 3 import java.util.ArrayList ; 4 import com.geinuke.middle.IBlogBL; 5 import com.geinuke.middle.INewsBL; 6 import com.geinuke.middle.ISearchBL; 7 import com.geinuke.middle.ITopicBL; 8 import com.geinuke.middle.MiddleFactory; 9 import com.geinuke.util.SearchLinkConverter; 10 11 12 public class SearchBL implements ISearchBL{ 13 14 public ArrayList searchForumTopicsByText(String text) throws BLException { 15 ArrayList resp=null; 16 try{ 17 18 ITopicBL tbl=(ITopicBL)MiddleFactory.getBL("ITopicBL"); 19 20 if(text==null || text.trim().equals("")){ 21 return new ArrayList (); 22 }else { 23 resp=tbl.getForumTopicsByText(text); 24 } 25 26 27 }catch(Throwable t){ 28 throw new BLException(t.getMessage()); 29 } 30 31 return SearchLinkConverter.getLinksFromForumTopics(resp); 32 } 33 34 37 public ArrayList searchNewsByTitleOrText(String text) throws BLException { 38 ArrayList resp=null; 39 try{ 40 41 INewsBL nbl=(INewsBL)MiddleFactory.getBL("INewsBL"); 42 43 if(text==null || text.trim().equals("")){ 44 return new ArrayList (); 45 }else { 46 resp=nbl.getNewsByTitleOrText(text); 47 } 48 49 50 }catch(Throwable t){ 51 throw new BLException(t.getMessage()); 52 } 53 54 return SearchLinkConverter.getLinksFromNews(resp); 55 } 56 57 58 public ArrayList searchBlogPostsByText(String text) throws BLException { 59 ArrayList resp=null; 60 try{ 61 62 IBlogBL bbl=(IBlogBL)MiddleFactory.getBL("IBlogBL"); 63 64 if(text==null || text.trim().equals("")){ 65 return new ArrayList (); 66 }else { 67 resp=bbl.getBlogPostsByTitleOrText(text); 68 } 69 70 71 }catch(Throwable t){ 72 throw new BLException(t.getMessage()); 73 } 74 75 return SearchLinkConverter.getLinksFromBlogs(resp); 76 } 77 78 } 79 | Popular Tags |