Author: itthkjer
Date: 2006-05-09 10:54:27 +0200 (Tue, 09 May 2006)
New Revision: 2876

Modified:
   
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
   
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ImageHelper.java
Log:
updated ImageHelper for new version

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
      2006-05-08 14:35:20 UTC (rev 2875)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/configuration/SearchModeFactory.java
      2006-05-09 08:54:27 UTC (rev 2876)
@@ -668,6 +668,22 @@
                             }
                         }
                         break;
+                    case IMAGE_HELPER:
+                        final ImageHelper im = (ImageHelper) handler;
+                        {
+                            if(rh.getAttribute("fields").length() >0){
+                                final String[] fields = 
rh.getAttribute("fields").split(",");
+                                for(String field : fields){
+                                    if(field.contains(" AS ")){
+                                        final String[] ff = field.split(" AS 
");
+                                        im.addField(ff[0], ff[1]);
+                                    }else{
+                                        im.addField(field, field);
+                                    }
+                                }
+                            }
+                        }
+                        break;
                     case SPELLING_SUGGESTION_CHOOSER:
                         final SpellingSuggestionChooser ssc = 
(SpellingSuggestionChooser) handler;
                         ssc.setMinScore(parseInt(rh.getAttribute("min-score"), 
-1));

Modified: 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ImageHelper.java
===================================================================
--- 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ImageHelper.java
   2006-05-08 14:35:20 UTC (rev 2875)
+++ 
trunk/src/java/no/schibstedsok/front/searchportal/result/handler/ImageHelper.java
   2006-05-09 08:54:27 UTC (rev 2876)
@@ -18,8 +18,12 @@
  */
 public class ImageHelper implements ResultHandler {
 
-    private Map fieldMap = new HashMap();
+    private Map<String,String> fieldMap = new HashMap<String,String>();
 
+    public void addField(final String field, final String as){
+        fieldMap.put(field, as);
+    }
+
     public void handleResult(final Context cxt, final Map parameters) {
 
         for (final SearchResultItem item : cxt.getSearchResult().getResults()) 
{

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to