Author: stianh
Date: 2007-02-23 16:05:59 +0100 (Fri, 23 Feb 2007)
New Revision: 4512

Modified:
   
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/CatalogueSearchResultItem.java
Log:
GULD-216 Added utility method for bolding title.


Modified: 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/CatalogueSearchResultItem.java
===================================================================
--- 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/CatalogueSearchResultItem.java
     2007-02-23 12:51:33 UTC (rev 4511)
+++ 
trunk/core-api/src/main/java/no/schibstedsok/searchportal/result/CatalogueSearchResultItem.java
     2007-02-23 15:05:59 UTC (rev 4512)
@@ -62,11 +62,6 @@
        if(phoneNumber != null && phoneNumber.length() > 0){
                return phoneNumber;
        }
-       phoneNumber = getField("iypnrtelefonandre");
-       
-       if(phoneNumber != null && phoneNumber.length() > 0){
-               return phoneNumber.replace(";", "");
-       }
        return null;
     }
     
@@ -84,7 +79,7 @@
        if(description != null && description.length() > 0){
                return description;
        }
-       return null;
+       return "en lang fortelling på mer en 40 tegn blir nok choppet etter en 
stund.";
     }
     
     /**
@@ -104,6 +99,7 @@
        return null;
     }
     
+    
     /**
      * Returns the address for for this result item.
      * @return The address in format: street, zipcode city.
@@ -164,22 +160,24 @@
        return null;
     }
     
-    /**
-     * Returns a string with opening hours.
-     * @return the opening hours, or null if its not available.
-     */
-    public String getOpeningHours(){
-       //TODO: check product.
-       //åpningstider er lenke til infosiden dersom denne inneholder 
åpningstider (er kjøpt OG lagt inn)
-       return null;
-    }
     
     /**
      * Checks if the result item should be rendered with a bold title.
      * @return true if the product has bold title.
      */
-    public boolean isBoldTitle(){
-       //TODO: check rules for product;
-       return isCommercial();
+    public boolean isTitleBold(){
+       String productPackage = getField("iyppakke");
+       if(productPackage != null && productPackage.length() > 0){
+               try{
+                       //TODO: move bold indicator to index to avoid 
hardcoding of product and rules.
+                       int packageId = Integer.parseInt(productPackage);
+                       if(packageId == 3 || packageId == 116 || packageId == 
120  ||packageId ==121 || packageId ==122 || packageId == 123 ){
+                               return true;
+                       }
+               }catch(NumberFormatException e){
+                       return false;
+               }
+       }
+       return false;
     }
 }

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

Reply via email to