1 24 package org.ofbiz.content.search; 25 26 import java.util.ArrayList ; 27 import java.util.HashMap ; 28 import java.util.List ; 29 import java.util.Map ; 30 31 import org.ofbiz.base.util.Debug; 32 import org.ofbiz.entity.GenericDelegator; 33 import org.ofbiz.service.DispatchContext; 34 import org.ofbiz.service.ServiceUtil; 35 36 37 38 47 public class SearchServices { 48 49 public static final String module = SearchServices.class.getName(); 50 51 public static Map indexTree(DispatchContext dctx, Map context) { 52 53 String siteId = (String )context.get("contentId"); 54 String path = (String )context.get("path"); 55 Map envContext = new HashMap (); 56 GenericDelegator delegator = dctx.getDelegator(); 57 if (Debug.infoOn()) Debug.logInfo("in indexTree, siteId:" + siteId, module); 58 List badIndexList = new ArrayList (); 59 envContext.put("badIndexList", badIndexList); 60 envContext.put("goodIndexCount", new Integer (0)); 61 62 Map results = null; 63 try { 64 results = SearchWorker.indexTree(delegator, siteId, envContext, path); 65 } catch (Exception e) { 66 Debug.logError(e, module); 67 return ServiceUtil.returnError("Error indexing tree: " + e.toString()); 68 } 69 if (Debug.infoOn()) Debug.logInfo("in indexTree, results:" + results, module); 70 return results; 71 } 72 } 73 | Popular Tags |