1 16 package org.jahia.services.search; 17 18 import org.jahia.data.search.JahiaSearchResult; 19 import org.jahia.exceptions.JahiaException; 20 import org.jahia.params.ParamBean; 21 import org.jahia.registries.ServicesRegistry; 22 23 import java.util.ArrayList ; 24 25 26 32 33 public class PageSearcher extends JahiaSearcher { 34 35 private static final String CLASS_NAME = PageSearcher.class.getName (); 36 private ArrayList languageCodes = new ArrayList (); 37 private int[] siteIds = new int[]{}; 38 39 43 public PageSearcher (int[] siteIds) { 44 this.siteIds = siteIds; 45 } 46 47 51 public PageSearcher (int[] siteIds, ArrayList languageCodes) { 52 this(siteIds); 53 if (languageCodes != null) { 54 this.languageCodes = languageCodes; 55 } 56 } 57 58 68 public JahiaSearchResult search (String query, ParamBean jParams) 69 throws JahiaException { 70 JahiaSearchResult result = null; 71 72 setQuery (query); 74 75 ServicesRegistry sReg = ServicesRegistry.getInstance (); 77 result = sReg.getJahiaSearchService ().search (this, jParams); 78 79 setResult (result); 81 82 return result; 83 } 84 85 92 public String getName () { 93 return PageSearcher.PAGE_SEARCHER; 94 } 95 96 99 public ArrayList getLanguageCodes () { 100 return this.languageCodes; 101 } 102 103 public int[] getSiteIds() { 104 return siteIds; 105 } 106 107 public void setSiteIds(int[] siteIds) { 108 this.siteIds = siteIds; 109 } 110 111 } 112 | Popular Tags |